本文整理汇总了PHP中TYPO3\CMS\Core\Resource\Folder::checkActionPermission方法的典型用法代码示例。如果您正苦于以下问题:PHP Folder::checkActionPermission方法的具体用法?PHP Folder::checkActionPermission怎么用?PHP Folder::checkActionPermission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Resource\Folder
的用法示例。
在下文中一共展示了Folder::checkActionPermission方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array All available buttons as an assoc. array
*/
public function getButtons()
{
$buttons = array('csh' => '', 'shortcut' => '', 'upload' => '', 'new' => '');
// Add shortcut
if ($this->getBackendUser()->mayMakeShortcut()) {
$buttons['shortcut'] = $this->doc->makeShortcutIcon('pointer,id,target,table', implode(',', array_keys($this->MOD_MENU)), $this->moduleName);
}
// FileList Module CSH:
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'filelist_module');
// Upload button (only if upload to this directory is allowed)
if ($this->folderObject && $this->folderObject->getStorage()->checkUserActionPermission('add', 'File') && $this->folderObject->checkActionPermission('write')) {
$buttons['upload'] = '<a href="' . htmlspecialchars($GLOBALS['BACK_PATH'] . BackendUtility::getModuleUrl('file_upload', array('target' => $this->folderObject->getCombinedIdentifier(), 'returnUrl' => $this->filelist->listURL()))) . '" id="button-upload" title="' . $this->getLanguageService()->makeEntities($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.upload', TRUE)) . '">' . IconUtility::getSpriteIcon('actions-edit-upload') . '</a>';
}
// New folder button
if ($this->folderObject && $this->folderObject->checkActionPermission('write') && ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File') || $this->folderObject->checkActionPermission('add'))) {
$buttons['new'] = '<a href="' . htmlspecialchars($GLOBALS['BACK_PATH'] . BackendUtility::getModuleUrl('file_newfolder', array('target' => $this->folderObject->getCombinedIdentifier(), 'returnUrl' => $this->filelist->listURL()))) . '" title="' . $this->getLanguageService()->makeEntities($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.new', TRUE)) . '">' . IconUtility::getSpriteIcon('actions-document-new') . '</a>';
}
return $buttons;
}
示例2: initFileOrFolderRecord
/**
* Init file/folder parameters
*/
protected function initFileOrFolderRecord()
{
$fileOrFolderObject = ResourceFactory::getInstance()->retrieveFileOrFolderObject($this->uid);
if ($fileOrFolderObject instanceof Folder) {
$this->folderObject = $fileOrFolderObject;
$this->access = $this->folderObject->checkActionPermission('read');
$this->type = 'folder';
} else {
$this->fileObject = $fileOrFolderObject;
$this->access = $this->fileObject->checkActionPermission('read');
$this->type = 'file';
$this->table = 'sys_file';
try {
$this->row = BackendUtility::getRecordWSOL($this->table, $fileOrFolderObject->getUid());
} catch (\Exception $e) {
$this->row = array();
}
}
}
示例3: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array All available buttons as an assoc. array
* @todo Define visibility
*/
public function getButtons()
{
$buttons = array('csh' => '', 'shortcut' => '', 'upload' => '', 'new' => '');
// Add shortcut
if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
$buttons['shortcut'] = $this->doc->makeShortcutIcon('pointer,id,target,table', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']);
}
// FileList Module CSH:
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'filelist_module', $GLOBALS['BACK_PATH'], '', TRUE);
// Upload button (only if upload to this directory is allowed)
if ($this->folderObject && $this->folderObject->getStorage()->checkUserActionPermission('add', 'File') && $this->folderObject->checkActionPermission('write')) {
$buttons['upload'] = '<a href="' . $GLOBALS['BACK_PATH'] . 'file_upload.php?target=' . rawurlencode($this->folderObject->getCombinedIdentifier()) . '&returnUrl=' . rawurlencode($this->filelist->listURL()) . '" id="button-upload" title="' . $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.upload', TRUE)) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-upload') . '</a>';
}
// New folder button
if ($this->folderObject && $this->folderObject->checkActionPermission('write') && ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File') || $this->folderObject->checkActionPermission('add'))) {
$buttons['new'] = '<a href="' . $GLOBALS['BACK_PATH'] . 'file_newfolder.php?target=' . rawurlencode($this->folderObject->getCombinedIdentifier()) . '&returnUrl=' . rawurlencode($this->filelist->listURL()) . '" title="' . $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.new', TRUE)) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-new') . '</a>';
}
return $buttons;
}
示例4: initFileOrFolderRecord
/**
* Init file/folder parameters
*/
protected function initFileOrFolderRecord()
{
$fileOrFolderObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject($this->uid);
if ($fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\Folder) {
$this->folderObject = $fileOrFolderObject;
$this->access = $this->folderObject->checkActionPermission('read');
$this->type = 'folder';
} else {
$this->fileObject = $fileOrFolderObject;
$this->access = $this->fileObject->checkActionPermission('read');
$this->type = 'file';
$this->table = 'sys_file_metadata';
try {
$metaData = $fileOrFolderObject->_getMetaData();
$this->row = BackendUtility::getRecordWSOL($this->table, $metaData['uid']);
} catch (\Exception $e) {
$this->row = array();
}
}
}
示例5: expandFolder
/**
* For RTE: This displays all files from folder. No thumbnails shown
*
* @param Folder $folder The folder path to expand
* @param string $extensionList List of file extensions to show
* @return string HTML output
*/
public function expandFolder(Folder $folder, $extensionList = '')
{
if (!$folder->checkActionPermission('read')) {
return '';
}
$out = '<h3>' . htmlspecialchars($this->getTitle()) . ':</h3>';
// Create header element; The folder from which files are listed.
$titleLen = (int) $this->getBackendUser()->uc['titleLen'];
$folderIcon = $this->iconFactory->getIconForResource($folder, Icon::SIZE_SMALL);
$folderIcon .= htmlspecialchars(GeneralUtility::fixed_lgd_cs($folder->getIdentifier(), $titleLen));
$currentIdentifier = !empty($this->linkParts) ? $this->linkParts['url'] : '';
$selected = $currentIdentifier === $folder->getCombinedIdentifier() ? $this->additionalFolderClass : '';
$out .= '
<span class="' . $selected . '" title="' . htmlspecialchars($folder->getIdentifier()) . '">
' . $folderIcon . '
</span>
';
// Get files from the folder:
$folderContent = $this->getFolderContent($folder, $extensionList);
if (!empty($folderContent)) {
$out .= '<ul class="list-tree">';
foreach ($folderContent as $fileOrFolderObject) {
list($fileIdentifier, $icon) = $this->renderItem($fileOrFolderObject);
$selected = $currentIdentifier === $fileIdentifier ? ' class="active"' : '';
$out .= '<li' . $selected . '>
<span class="list-tree-group">
<a href="#" class="t3js-fileLink list-tree-group" title="' . htmlspecialchars($fileOrFolderObject->getName()) . '" data-file="file:' . htmlspecialchars($fileIdentifier) . '">
<span class="list-tree-icon">' . $icon . '</span>
<span class="list-tree-title">' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($fileOrFolderObject->getName(), $titleLen)) . '</span>
</a>
</span>
</li>';
}
$out .= '</ul>';
}
return $out;
}
示例6: renderFolders
/**
* @param Folder $parentFolder
* @return string HTML code
*/
protected function renderFolders(Folder $parentFolder)
{
if (!$parentFolder->checkActionPermission('read')) {
return '';
}
$content = '';
$lang = $this->getLanguageService();
$folders = $parentFolder->getSubfolders();
$folderIdentifier = $parentFolder->getCombinedIdentifier();
// Create headline (showing number of folders):
$content .= '<h3>' . sprintf($lang->getLL('folders', true) . ' (%s):', count($folders)) . '</h3>';
$titleLength = (int) $this->getBackendUser()->uc['titleLen'];
// Create the header of current folder:
$folderIcon = '<a href="#" data-folder-id="' . htmlspecialchars($folderIdentifier) . '" data-close="1">';
$folderIcon .= $this->iconFactory->getIcon('apps-filetree-folder-default', Icon::SIZE_SMALL);
$folderIcon .= htmlspecialchars(GeneralUtility::fixed_lgd_cs($parentFolder->getName(), $titleLength));
$folderIcon .= '</a>';
$content .= $folderIcon . '<br />';
$lines = array();
// Traverse the folder list:
foreach ($folders as $subFolder) {
$subFolderIdentifier = $subFolder->getCombinedIdentifier();
// Create folder icon:
$icon = '<span style="width: 16px; height: 16px; display: inline-block;"></span>';
$icon .= '<span title="' . htmlspecialchars($subFolder->getName()) . '">' . $this->iconFactory->getIcon('apps-filetree-folder-default', Icon::SIZE_SMALL) . '</span>';
// Create links for adding the folder:
$aTag = '<a href="#" data-folder-id="' . htmlspecialchars($folderIdentifier) . '" data-close="0">';
$aTag_alt = '<a href="#" data-folder-id="' . htmlspecialchars($folderIdentifier) . '" data-close="1">';
if (strstr($subFolderIdentifier, ',') || strstr($subFolderIdentifier, '|')) {
// In case an invalid character is in the filepath, display error message:
$errorMessage = sprintf($lang->getLL('invalidChar', true), ', |');
$aTag = '<a href="#" class="t3-js-folderIdError" data-message="' . $errorMessage . '">';
}
$aTag_e = '</a>';
// Combine icon and folderpath:
$foldernameAndIcon = $aTag_alt . $icon . htmlspecialchars(GeneralUtility::fixed_lgd_cs($subFolder->getName(), $titleLength)) . $aTag_e;
$lines[] = '
<tr class="bgColor4">
<td nowrap="nowrap">' . $foldernameAndIcon . ' </td>
<td>' . $aTag . '<span title="' . $lang->getLL('addToList', true) . '">' . $this->iconFactory->getIcon('actions-edit-add', Icon::SIZE_SMALL)->render() . '</span>' . $aTag_e . '</td>
<td> </td>
</tr>';
$lines[] = '
<tr>
<td colspan="3"><span style="width: 1px; height: 3px; display: inline-block;"></span></td>
</tr>';
}
// Wrap all the rows in table tags:
$content .= '
<!--
Folder listing
-->
<table border="0" cellpadding="0" cellspacing="1" id="typo3-folderList">
' . implode('', $lines) . '
</table>';
return $content;
}
示例7: makeClip
/**
* Creates the clipboard control pad
*
* @param \TYPO3\CMS\Core\Resource\File|\TYPO3\CMS\Core\Resource\Folder $fileOrFolderObject Array with information about the file/directory for which to make the clipboard panel for the listing.
* @return string HTML-table
* @todo Define visibility
*/
public function makeClip($fileOrFolderObject)
{
if (!$fileOrFolderObject->checkActionPermission('read')) {
return '';
}
$cells = array();
$fullIdentifier = $fileOrFolderObject->getCombinedIdentifier();
$md5 = GeneralUtility::shortmd5($fullIdentifier);
// For normal clipboard, add copy/cut buttons:
if ($this->clipObj->current == 'normal') {
$isSel = $this->clipObj->isSelected('_FILE', $md5);
$cells[] = '<a href="' . htmlspecialchars($this->clipObj->selUrlFile($fullIdentifier, 1, $isSel == 'copy')) . '">' . IconUtility::getSpriteIcon('actions-edit-copy' . ($isSel == 'copy' ? '-release' : ''), array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.copy', TRUE))) . '</a>';
// we can only cut if file can be moved
if ($fileOrFolderObject->checkActionPermission('move')) {
$cells[] = '<a href="' . htmlspecialchars($this->clipObj->selUrlFile($fullIdentifier, 0, $isSel == 'cut')) . '">' . IconUtility::getSpriteIcon('actions-edit-cut' . ($isSel == 'cut' ? '-release' : ''), array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.cut', TRUE))) . '</a>';
} else {
$cells[] = IconUtility::getSpriteIcon('empty-empty');
}
} else {
// For numeric pads, add select checkboxes:
$n = '_FILE|' . $md5;
$this->CBnames[] = $n;
$checked = $this->clipObj->isSelected('_FILE', $md5) ? ' checked="checked"' : '';
$cells[] = '<input type="hidden" name="CBH[' . $n . ']" value="0" />' . '<input type="checkbox" name="CBC[' . $n . ']" value="' . htmlspecialchars($fullIdentifier) . '" class="smallCheckboxes"' . $checked . ' />';
}
// Display PASTE button, if directory:
$elFromTable = $this->clipObj->elFromTable('_FILE');
if (is_a($fileOrFolderObject, 'TYPO3\\CMS\\Core\\Resource\\Folder') && count($elFromTable) && $fileOrFolderObject->checkActionPermission('write')) {
$addPasteButton = TRUE;
foreach ($elFromTable as $element) {
$clipBoardElement = $this->resourceFactory->retrieveFileOrFolderObject($element);
if ($clipBoardElement instanceof Folder && $clipBoardElement->getStorage()->isWithinFolder($clipBoardElement, $fileOrFolderObject)) {
$addPasteButton = FALSE;
}
}
if ($addPasteButton) {
$cells[] = '<a class="btn" href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $fullIdentifier)) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $fullIdentifier, 'into', $elFromTable)) . '" title="' . $GLOBALS['LANG']->getLL('clip_pasteInto', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-paste-into') . '</a>';
}
}
// Compile items into a DIV-element:
return ' <!-- CLIPBOARD PANEL: -->
<div class="typo3-clipCtrl">
' . implode('
', $cells) . '
</div>';
}
示例8: makeEdit
/**
* Creates the edit control section
*
* @param File|Folder $fileOrFolderObject Array with information about the file/directory for which to make the edit control section for the listing.
* @return string HTML-table
*/
public function makeEdit($fileOrFolderObject)
{
$cells = array();
$fullIdentifier = $fileOrFolderObject->getCombinedIdentifier();
// Edit file content (if editable)
if ($fileOrFolderObject instanceof File && $fileOrFolderObject->checkActionPermission('write') && GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext'], $fileOrFolderObject->getExtension())) {
$url = BackendUtility::getModuleUrl('file_edit', array('target' => $fullIdentifier));
$editOnClick = 'top.content.list_frame.location.href=' . GeneralUtility::quoteJSvalue($url) . '+\'&returnUrl=\'+top.rawurlencode(top.content.list_frame.document.location.pathname+top.content.list_frame.document.location.search);return false;';
$cells['edit'] = '<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($editOnClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.editcontent') . '">' . IconUtility::getSpriteIcon('actions-page-open') . '</a>';
} else {
$cells['edit'] = $this->spaceIcon;
}
if ($fileOrFolderObject instanceof File) {
$fileUrl = $fileOrFolderObject->getPublicUrl(TRUE);
if ($fileUrl) {
$aOnClick = 'return top.openUrlInWindow(' . GeneralUtility::quoteJSvalue($fileUrl) . ', \'WebFile\');';
$cells['view'] = '<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($aOnClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.view') . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
} else {
$cells['view'] = $this->spaceIcon;
}
} else {
$cells['view'] = $this->spaceIcon;
}
// rename the file
if ($fileOrFolderObject->checkActionPermission('rename')) {
$url = BackendUtility::getModuleUrl('file_rename', array('target' => $fullIdentifier));
$renameOnClick = 'top.content.list_frame.location.href = ' . GeneralUtility::quoteJSvalue($url) . '+\'&returnUrl=\'+top.rawurlencode(top.content.list_frame.document.location.pathname+top.content.list_frame.document.location.search);return false;';
$cells['rename'] = '<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($renameOnClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.rename') . '">' . IconUtility::getSpriteIcon('actions-edit-rename') . '</a>';
} else {
$cells['rename'] = $this->spaceIcon;
}
if ($fileOrFolderObject->checkActionPermission('read')) {
$infoOnClick = '';
if ($fileOrFolderObject instanceof Folder) {
$infoOnClick = 'top.launchView( \'_FOLDER\', ' . GeneralUtility::quoteJSvalue($fullIdentifier) . ');return false;';
} elseif ($fileOrFolderObject instanceof File) {
$infoOnClick = 'top.launchView( \'_FILE\', ' . GeneralUtility::quoteJSvalue($fullIdentifier) . ');return false;';
}
$cells['info'] = '<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($infoOnClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.info') . '">' . IconUtility::getSpriteIcon('status-dialog-information') . '</a>';
} else {
$cells['info'] = $this->spaceIcon;
}
// delete the file
if ($fileOrFolderObject->checkActionPermission('delete')) {
$identifier = $fileOrFolderObject->getIdentifier();
if ($fileOrFolderObject instanceof Folder) {
$referenceCountText = BackendUtility::referenceCount('_FILE', $identifier, ' (There are %s reference(s) to this folder!)');
} else {
$referenceCountText = BackendUtility::referenceCount('sys_file', $fileOrFolderObject->getUid(), ' (There are %s reference(s) to this file!)');
}
if ($this->getBackendUser()->jsConfirmation(JsConfirmation::DELETE)) {
$confirmationCheck = 'confirm(' . GeneralUtility::quoteJSvalue(sprintf($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:mess.delete'), $fileOrFolderObject->getName()) . $referenceCountText) . ')';
} else {
$confirmationCheck = '1 == 1';
}
$removeOnClick = 'if (' . $confirmationCheck . ') { top.content.list_frame.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_file') . '&file[delete][0][data]=' . rawurlencode($fileOrFolderObject->getCombinedIdentifier()) . '&vC=' . $this->getBackendUser()->veriCode() . BackendUtility::getUrlToken('tceAction') . '&redirect=') . '+top.rawurlencode(top.content.list_frame.document.location.pathname+top.content.list_frame.document.location.search);};';
$cells['delete'] = '<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($removeOnClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.delete') . '">' . IconUtility::getSpriteIcon('actions-edit-delete') . '</a>';
} else {
$cells['delete'] = $this->spaceIcon;
}
// Hook for manipulating edit icons.
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'] as $classData) {
$hookObject = GeneralUtility::getUserObj($classData);
if (!$hookObject instanceof FileListEditIconHookInterface) {
throw new \UnexpectedValueException('$hookObject must implement interface \\TYPO3\\CMS\\Filelist\\FileListEditIconHookInterface', 1235225797);
}
$hookObject->manipulateEditIcons($cells, $this);
}
}
// Compile items into a DIV-element:
return '<div class="btn-group">' . implode('', $cells) . '</div>';
}
示例9: main
/**
* Main function, rendering the main module content
*
* @return void
*/
public function main()
{
$lang = $this->getLanguageService();
// Start content compilation
$this->content .= $this->doc->startPage($lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.pagetitle'));
// Make page header:
$pageContent = $this->doc->header($lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.pagetitle'));
if ($this->folderObject->checkActionPermission('add')) {
$code = '<form role="form" action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_file')) . '" method="post" name="editform">';
// Making the selector box for the number of concurrent folder-creations
$this->number = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->number, 1, 10);
$code .= '
<div class="form-group">
<div class="form-section">
<div class="form-group">
<label for="number-of-new-folders">' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.number_of_folders') . ' ' . BackendUtility::cshItem('xMOD_csh_corebe', 'file_newfolder') . '</label>
<div class="form-control-wrap">
<div class="input-group">
<select class="form-control form-control-adapt" name="number" id="number-of-new-folders" onchange="reload(this.options[this.selectedIndex].value);">';
for ($a = 1; $a <= $this->folderNumber; $a++) {
$code .= '<option value="' . $a . '"' . ($this->number == $a ? ' selected="selected"' : '') . '>' . $a . '</option>';
}
$code .= '
</select>
</div>
</div>
</div>
</div>
';
// Making the number of new-folder boxes needed:
for ($a = 0; $a < $this->number; $a++) {
$code .= '
<div class="form-section">
<div class="form-group">
<label for="folder_new_' . $a . '">' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.label_newfolder') . ' ' . ($a + 1) . ':</label>
<div class="form-control-wrap">
<input type="text" class="form-control" id="folder_new_' . $a . '" name="file[newfolder][' . $a . '][data]" onchange="changed=true;" />
<input type="hidden" name="file[newfolder][' . $a . '][target]" value="' . htmlspecialchars($this->target) . '" />
</div>
</div>
</div>';
}
// Making submit button for folder creation:
$code .= '
</div><div class="form-group">
<input class="btn btn-default" type="submit" value="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.submit', TRUE) . '" />
<input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" />
' . \TYPO3\CMS\Backend\Form\FormEngine::getHiddenTokenField('tceAction') . '
</div>
';
// Switching form tags:
$pageContent .= $this->doc->section($lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfolders'), $code);
$pageContent .= $this->doc->sectionEnd() . '</form>';
}
if ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File')) {
$pageContent .= '<form action="' . BackendUtility::getModuleUrl('tce_file') . '" method="post" name="editform2">';
// Create a list of allowed file extensions with the nice format "*.jpg, *.gif" etc.
$fileExtList = array();
$textFileExt = GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext'], TRUE);
foreach ($textFileExt as $fileExt) {
if (!preg_match('/' . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'] . '/i', '.' . $fileExt)) {
$fileExtList[] = '<span class="label label-success">' . strtoupper(htmlspecialchars($fileExt)) . '</span>';
}
}
// Add form fields for creation of a new, blank text file:
$code = '
<div class="form-group">
<div class="form-section">
<div class="form-group">
<label for="newfile">' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.label_newfile') . ' ' . BackendUtility::cshItem('xMOD_csh_corebe', 'file_newfile') . '</label>
<div class="form-control-wrap">
<input class="form-control" type="text" id="newfile" name="file[newfile][0][data]" onchange="changed=true;" />
<input type="hidden" name="file[newfile][0][target]" value="' . htmlspecialchars($this->target) . '" />
</div>
<div class="help-block">
' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:cm.allowedFileExtensions') . '<br>
' . implode(' ', $fileExtList) . '
</div>
</div>
</div>
</div>
';
// Submit button for creation of a new file:
$code .= '
<div class="form-group">
<input class="btn btn-default" type="submit" value="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfile_submit', TRUE) . '" />
<input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" />
' . \TYPO3\CMS\Backend\Form\FormEngine::getHiddenTokenField('tceAction') . '
</div>
';
$pageContent .= $this->doc->section($lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfile'), $code);
$pageContent .= $this->doc->sectionEnd();
$pageContent .= '</form>';
}
$docHeaderButtons = array('back' => '');
//.........这里部分代码省略.........
示例10: dirData
/**
* Returns some data specific for the directories...
*
* @param \TYPO3\CMS\Core\Resource\Folder $folderObject File information array
* @return array (title, icon, path)
* @todo Define visibility
*/
public function dirData(\TYPO3\CMS\Core\Resource\Folder $folderObject)
{
$title = htmlspecialchars($folderObject->getName());
$icon = 'apps-filetree-folder-default';
if ($title == '_temp_') {
$icon = 'apps-filetree-folder-temp';
$title = '<strong>' . $GLOBALS['LANG']->getLL('temp', TRUE) . '</strong>';
}
if ($title == '_recycler_') {
$icon = 'apps-filetree-folder-recycler';
$title = '<strong>' . $GLOBALS['LANG']->getLL('recycler', TRUE) . '</strong>';
}
// Mark the icon as read-only icon if the folder is not writable
if ($folderObject->checkActionPermission('write') === FALSE) {
$icon = 'apps-filetree-folder-locked';
}
return array($title, $icon, $folderObject->getIdentifier());
}
示例11: createFolder
/**
* For TBE: Makes a form for creating new folders in the filemount the user is browsing.
* The folder creation request is sent to the tce_file.php script in the core which will handle the creation.
*
* @param Folder $folderObject Absolute filepath on server in which to create the new folder.
* @return string HTML for the create folder form.
*/
public function createFolder(Folder $folderObject)
{
if (!$folderObject->checkActionPermission('write')) {
return '';
}
$backendUser = $this->getBackendUser();
if (!($backendUser->isAdmin() || $backendUser->getTSConfigVal('options.createFoldersInEB'))) {
return '';
}
// Don't show Folder-create form if it's denied
if ($backendUser->getTSConfigVal('options.folderTree.hideCreateFolder')) {
return '';
}
$lang = $this->getLanguageService();
// Create header, showing upload path:
$header = $folderObject->getIdentifier();
$code = '
<!--
Form, for creating new folders:
-->
<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_file')) . '" method="post" name="editform2" id="typo3-crFolderForm">
<table border="0" cellpadding="0" cellspacing="0" id="typo3-crFolder">
<tr>
<td>' . $this->barheader($lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.pagetitle') . ':') . '</td>
</tr>
<tr>
<td class="c-wCell c-hCell"><strong>' . $lang->getLL('path', true) . ':</strong> ' . htmlspecialchars($header) . '</td>
</tr>
<tr>
<td class="c-wCell c-hCell">';
// Create the new-folder name field:
$a = 1;
$code .= '<input' . $this->doc->formWidth(20) . ' type="text" name="file[newfolder][' . $a . '][data]" />' . '<input type="hidden" name="file[newfolder][' . $a . '][target]" value="' . htmlspecialchars($folderObject->getCombinedIdentifier()) . '" />';
// Make footer of upload form, including the submit button:
$redirectValue = $this->getThisScript() . 'act=' . $this->act . '&mode=' . $this->mode . '&expandFolder=' . rawurlencode($folderObject->getCombinedIdentifier()) . '&bparams=' . rawurlencode($this->bparams) . (is_array($this->P) ? GeneralUtility::implodeArrayForUrl('P', $this->P) : '');
$code .= '<input type="hidden" name="redirect" value="' . htmlspecialchars($redirectValue) . '" />' . '<input class="btn btn-default" type="submit" name="submit" value="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.submit', true) . '" />';
$code .= '</td>
</tr>
</table>
</form>';
return $code;
}
示例12: init
/**
* Initialization of the class
* Will determine if table/uid GET vars are database record or a file and if
* the user has access to view information about the item.
*
* @return void
* @todo Define visibility
*/
public function init()
{
// Setting input variables.
$this->table = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('table');
$this->uid = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('uid');
// Initialize:
$this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
// Set to TRUE if there is access to the record / file.
$this->access = FALSE;
// Sets the type, "db" or "file". If blank, nothing can be shown.
$this->type = '';
// Checking if the $table value is really a table and if the user has
// access to it.
if (isset($GLOBALS['TCA'][$this->table])) {
\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($this->table);
$this->type = 'db';
$this->uid = intval($this->uid);
// Check permissions and uid value:
if ($this->uid && $GLOBALS['BE_USER']->check('tables_select', $this->table)) {
if ((string) $this->table == 'pages') {
$this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->uid, $this->perms_clause);
$this->access = is_array($this->pageinfo) ? 1 : 0;
$this->row = $this->pageinfo;
} else {
$this->row = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL($this->table, $this->uid);
if ($this->row) {
$this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->row['pid'], $this->perms_clause);
$this->access = is_array($this->pageinfo) ? 1 : 0;
}
}
/** @var $treatData \TYPO3\CMS\Backend\Form\DataPreprocessor */
$treatData = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\DataPreprocessor');
$treatData->renderRecord($this->table, $this->uid, 0, $this->row);
}
} elseif ($this->table == '_FILE' || $this->table == '_FOLDER' || $this->table == 'sys_file') {
$fileOrFolderObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject($this->uid);
if ($fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\Folder) {
$this->folderObject = $fileOrFolderObject;
$this->access = $this->folderObject->checkActionPermission('read');
$this->type = 'folder';
} else {
$this->fileObject = $fileOrFolderObject;
$this->access = $this->fileObject->checkActionPermission('read');
$this->type = 'file';
$this->table = 'sys_file';
\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($this->table);
try {
$this->row = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL($this->table, $this->fileObject->getUid());
} catch (\Exception $e) {
$this->row = array();
}
}
}
// Initialize document template object:
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
// Starting the page by creating page header stuff:
$this->content .= $this->doc->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.viewItem'));
$this->content .= '<h3 class="t3-row-header">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:show_item.php.viewItem') . '</h3>';
$this->content .= $this->doc->spacer(5);
}
示例13: createFolder
/**
* For TBE: Makes a form for creating new folders in the filemount the user is browsing.
* The folder creation request is sent to the tce_file.php script in the core which will handle the creation.
*
* @param Folder $folderObject Absolute filepath on server in which to create the new folder.
* @return string HTML for the create folder form.
* @todo Define visibility
*/
public function createFolder(Folder $folderObject)
{
if (!$folderObject->checkActionPermission('write')) {
return '';
}
if (!($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->getTSConfigVal('options.createFoldersInEB'))) {
return '';
}
// Don't show Folder-create form if it's denied
if ($GLOBALS['BE_USER']->getTSConfigVal('options.folderTree.hideCreateFolder')) {
return '';
}
// Create header, showing upload path:
$header = $folderObject->getIdentifier();
$code = '
<!--
Form, for creating new folders:
-->
<form action="' . $GLOBALS['BACK_PATH'] . 'tce_file.php" method="post" name="editform2" id="typo3-crFolderForm">
<table border="0" cellpadding="0" cellspacing="0" id="typo3-crFolder">
<tr>
<td>' . $this->barheader($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.pagetitle') . ':') . '</td>
</tr>
<tr>
<td class="c-wCell c-hCell"><strong>' . $GLOBALS['LANG']->getLL('path', TRUE) . ':</strong> ' . htmlspecialchars($header) . '</td>
</tr>
<tr>
<td class="c-wCell c-hCell">';
// Create the new-folder name field:
$a = 1;
$code .= '<input' . $this->doc->formWidth(20) . ' type="text" name="file[newfolder][' . $a . '][data]" />' . '<input type="hidden" name="file[newfolder][' . $a . '][target]" value="' . htmlspecialchars($folderObject->getCombinedIdentifier()) . '" />';
// Make footer of upload form, including the submit button:
$redirectValue = $this->getThisScript() . 'act=' . $this->act . '&mode=' . $this->mode . '&expandFolder=' . rawurlencode($folderObject->getCombinedIdentifier()) . '&bparams=' . rawurlencode($this->bparams);
$code .= '<input type="hidden" name="redirect" value="' . htmlspecialchars($redirectValue) . '" />' . \TYPO3\CMS\Backend\Form\FormEngine::getHiddenTokenField('tceAction') . '<input type="submit" name="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.submit', TRUE) . '" />';
$code .= '</td>
</tr>
</table>
</form>';
return $code;
}
示例14: renderFilesInFolder
/**
* For TYPO3 Element Browser: Expand folder of files.
*
* @param Folder $folder The folder path to expand
* @param array $extensionList List of fileextensions to show
* @param bool $noThumbs Whether to show thumbnails or not. If set, no thumbnails are shown.
* @return string HTML output
*/
public function renderFilesInFolder(Folder $folder, array $extensionList = [], $noThumbs = false)
{
if (!$folder->checkActionPermission('read')) {
return '';
}
$lang = $this->getLanguageService();
$titleLen = (int) $this->getBackendUser()->uc['titleLen'];
if ($this->searchWord !== '') {
$files = $this->fileRepository->searchByName($folder, $this->searchWord);
} else {
$extensionList = !empty($extensionList) && $extensionList[0] === '*' ? [] : $extensionList;
$files = $this->getFilesInFolder($folder, $extensionList);
}
$filesCount = count($files);
$lines = array();
// Create the header of current folder:
$folderIcon = $this->iconFactory->getIconForResource($folder, Icon::SIZE_SMALL);
$lines[] = '
<tr>
<th class="col-title" nowrap="nowrap">' . $folderIcon . ' ' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($folder->getIdentifier(), $titleLen)) . '</th>
<th class="col-control" nowrap="nowrap"></th>
<th class="col-clipboard" nowrap="nowrap">
<a href="#" class="btn btn-default" id="t3js-importSelection" title="' . $lang->getLL('importSelection', true) . '">' . $this->iconFactory->getIcon('actions-document-import-t3d', Icon::SIZE_SMALL) . '</a>
<a href="#" class="btn btn-default" id="t3js-toggleSelection" title="' . $lang->getLL('toggleSelection', true) . '">' . $this->iconFactory->getIcon('actions-document-select', Icon::SIZE_SMALL) . '</a>
</th>
<th nowrap="nowrap"> </th>
</tr>';
if ($filesCount === 0) {
$lines[] = '
<tr>
<td colspan="4">No files found.</td>
</tr>';
}
foreach ($files as $fileObject) {
$fileExtension = $fileObject->getExtension();
// Thumbnail/size generation:
$imgInfo = array();
if (!$noThumbs && GeneralUtility::inList(strtolower($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] . ',' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext']), strtolower($fileExtension))) {
$processedFile = $fileObject->process(ProcessedFile::CONTEXT_IMAGEPREVIEW, array('width' => 64, 'height' => 64));
$imageUrl = $processedFile->getPublicUrl(true);
$imgInfo = array($fileObject->getProperty('width'), $fileObject->getProperty('height'));
$pDim = $imgInfo[0] . 'x' . $imgInfo[1] . ' pixels';
$clickIcon = '<img src="' . $imageUrl . '"' . ' width="' . $processedFile->getProperty('width') . '"' . ' height="' . $processedFile->getProperty('height') . '"' . ' hspace="5" vspace="5" border="1" />';
} else {
$clickIcon = '';
$pDim = '';
}
// Create file icon:
$size = ' (' . GeneralUtility::formatSize($fileObject->getSize()) . 'bytes' . ($pDim ? ', ' . $pDim : '') . ')';
$icon = '<span title="' . htmlspecialchars($fileObject->getName() . $size) . '">' . $this->iconFactory->getIconForResource($fileObject, Icon::SIZE_SMALL) . '</span>';
// Create links for adding the file:
$filesIndex = count($this->elements);
$this->elements['file_' . $filesIndex] = array('type' => 'file', 'table' => 'sys_file', 'uid' => $fileObject->getUid(), 'fileName' => $fileObject->getName(), 'filePath' => $fileObject->getUid(), 'fileExt' => $fileExtension, 'fileIcon' => $icon);
if ($this->fileIsSelectableInFileList($fileObject, $imgInfo)) {
$ATag = '<a href="#" class="btn btn-default" title="' . htmlspecialchars($fileObject->getName()) . '" data-file-index="' . htmlspecialchars($filesIndex) . '" data-close="0">';
$ATag_alt = '<a href="#" title="' . htmlspecialchars($fileObject->getName()) . '" data-file-index="' . htmlspecialchars($filesIndex) . '" data-close="1">';
$ATag_e = '</a>';
$bulkCheckBox = '<label class="btn btn-default btn-checkbox"><input type="checkbox" class="typo3-bulk-item" name="file_' . $filesIndex . '" value="0" /><span class="t3-icon fa"></span></label>';
} else {
$ATag = '';
$ATag_alt = '';
$ATag_e = '';
$bulkCheckBox = '';
}
// Create link to showing details about the file in a window:
$Ahref = BackendUtility::getModuleUrl('show_item', array('type' => 'file', 'table' => '_FILE', 'uid' => $fileObject->getCombinedIdentifier(), 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')));
// Combine the stuff:
$filenameAndIcon = $ATag_alt . $icon . htmlspecialchars(GeneralUtility::fixed_lgd_cs($fileObject->getName(), $titleLen)) . $ATag_e;
// Show element:
$lines[] = '
<tr class="file_list_normal">
<td class="col-title" nowrap="nowrap">' . $filenameAndIcon . ' </td>
<td class="col-control">
<div class="btn-group">' . $ATag . '<span title="' . $lang->getLL('addToList', true) . '">' . $this->iconFactory->getIcon('actions-edit-add', Icon::SIZE_SMALL)->render() . '</span>' . $ATag_e . '
<a href="' . htmlspecialchars($Ahref) . '" class="btn btn-default" title="' . $lang->getLL('info', true) . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . '</a>
</td>
<td class="col-clipboard" valign="top">' . $bulkCheckBox . '</td>
<td nowrap="nowrap"> ' . $pDim . '</td>
</tr>';
if ($pDim) {
$lines[] = '
<tr>
<td class="filelistThumbnail" colspan="4">' . $ATag_alt . $clickIcon . $ATag_e . '</td>
</tr>';
}
}
$out = '<h3>' . $lang->getLL('files', true) . ' ' . $filesCount . ':</h3>';
$out .= GeneralUtility::makeInstance(FolderUtilityRenderer::class, $this)->getFileSearchField($this->searchWord);
$out .= '<div id="filelist">';
$out .= $this->getBulkSelector($filesCount);
// Wrap all the rows in table tags:
$out .= '
//.........这里部分代码省略.........
示例15: uploadForm
/**
* Makes an upload form for uploading files to the filemount the user is browsing.
* The files are uploaded to the tce_file.php script in the core which will handle the upload.
*
* @param Folder $folderObject
* @param string[] $allowedExtensions
*
* @return string HTML for an upload form.
*/
public function uploadForm(Folder $folderObject, array $allowedExtensions)
{
if (!$folderObject->checkActionPermission('write')) {
return '';
}
// Read configuration of upload field count
$userSetting = $this->getBackendUser()->getTSConfigVal('options.folderTree.uploadFieldsInLinkBrowser');
$count = isset($userSetting) ? (int) $userSetting : 1;
if ($count === 0) {
return '';
}
$count = (int) $count === 0 ? 1 : (int) $count;
// Create header, showing upload path:
$header = $folderObject->getIdentifier();
$lang = $this->getLanguageService();
// Create a list of allowed file extensions with the readable format "youtube, vimeo" etc.
$fileExtList = array();
foreach ($allowedExtensions as $fileExt) {
if (GeneralUtility::verifyFilenameAgainstDenyPattern($fileExt)) {
$fileExtList[] = '<span class="label label-success">' . strtoupper(htmlspecialchars($fileExt)) . '</span>';
}
}
$formAction = BackendUtility::getModuleUrl('tce_file');
$combinedIdentifier = $folderObject->getCombinedIdentifier();
$markup = array();
$markup[] = '<div class="element-browser-section element-browser-upload">';
$markup[] = ' <form action="' . htmlspecialchars($formAction) . '" method="post" name="editform" enctype="multipart/form-data">';
$markup[] = ' <h3>' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.pagetitle', true) . ':</h3>';
$markup[] = ' <p><strong>' . $lang->getLL('path', true) . ':</strong>' . htmlspecialchars($header) . '</p>';
// Traverse the number of upload fields:
for ($a = 1; $a <= $count; $a++) {
$markup[] = '<div class="form-group">';
$markup[] = '<span class="btn btn-default btn-file">';
$markup[] = '<input type="file" multiple="multiple" name="upload_' . $a . '[]" size="50" />';
$markup[] = '</span>';
$markup[] = '</div>';
$markup[] = '<input type="hidden" name="file[upload][' . $a . '][target]" value="' . htmlspecialchars($combinedIdentifier) . '" />';
$markup[] = '<input type="hidden" name="file[upload][' . $a . '][data]" value="' . $a . '" />';
}
$redirectValue = $this->parameterProvider->getScriptUrl() . GeneralUtility::implodeArrayForUrl('', $this->parameterProvider->getUrlParameters(['identifier' => $combinedIdentifier]));
$markup[] = '<input type="hidden" name="redirect" value="' . htmlspecialchars($redirectValue) . '" />';
if (!empty($fileExtList)) {
$markup[] = '<div class="form-group">';
$markup[] = ' <label>';
$markup[] = $lang->sL('LLL:EXT:lang/locallang_core.xlf:cm.allowedFileExtensions', true) . '<br/>';
$markup[] = ' </label>';
$markup[] = ' <div class="form-control">';
$markup[] = implode(' ', $fileExtList);
$markup[] = ' </div>';
$markup[] = '</div>';
}
$markup[] = '<div class="checkbox">';
$markup[] = ' <label>';
$markup[] = ' <input type="checkbox" name="overwriteExistingFiles" id="overwriteExistingFiles" value="1" />';
$markup[] = $lang->sL('LLL:EXT:lang/locallang_misc.xlf:overwriteExistingFiles', true);
$markup[] = ' </label>';
$markup[] = '</div>';
$markup[] = '<input class="btn btn-default" type="submit" name="submit" value="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.submit', true) . '" />';
$markup[] = ' </form>';
$markup[] = '</div>';
$code = implode(LF, $markup);
// Add online media
// Create a list of allowed file extensions in a readable format "youtube, vimeo" etc.
$fileExtList = array();
$onlineMediaFileExt = OnlineMediaHelperRegistry::getInstance()->getSupportedFileExtensions();
foreach ($onlineMediaFileExt as $fileExt) {
if (GeneralUtility::verifyFilenameAgainstDenyPattern($fileExt) && (empty($allowedExtensions) || in_array($fileExt, $allowedExtensions, true))) {
$fileExtList[] = '<span class="label label-success">' . strtoupper(htmlspecialchars($fileExt)) . '</span>';
}
}
if (!empty($fileExtList)) {
$formAction = BackendUtility::getModuleUrl('online_media');
$markup = array();
$markup[] = '<div class="element-browser-section element-browser-mediaurls">';
$markup[] = ' <form action="' . htmlspecialchars($formAction) . '" method="post" name="editform1" id="typo3-addMediaForm" enctype="multipart/form-data">';
$markup[] = '<h3>' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media', true) . ':</h3>';
$markup[] = '<p><strong>' . $lang->getLL('path', true) . ':</strong>' . htmlspecialchars($header) . '</p>';
$markup[] = '<div class="form-group">';
$markup[] = '<input type="hidden" name="file[newMedia][0][target]" value="' . htmlspecialchars($folderObject->getCombinedIdentifier()) . '" />';
$markup[] = '<input type="hidden" name="file[newMedia][0][allowed]" value="' . htmlspecialchars(implode(',', $allowedExtensions)) . '" />';
$markup[] = '<input type="text" name="file[newMedia][0][url]" class="form-control" placeholder="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.placeholder', true) . '" />';
$markup[] = '<button class="btn btn-default">' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.submit', true) . '</button>';
$markup[] = '</div>';
$markup[] = '<div class="form-group">';
$markup[] = ' <label>';
$markup[] = $lang->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.allowedProviders') . '<br/>';
$markup[] = ' </label>';
$markup[] = ' <div class="form-control">';
$markup[] = implode(' ', $fileExtList);
$markup[] = ' </div>';
$markup[] = '</div>';
//.........这里部分代码省略.........