示例#1
0
 /**
  * Main function, rendering the upload file form fields
  *
  * @return void
  */
 public function main()
 {
     // Make page header:
     $this->content = $this->doc->startPage($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.pagetitle'));
     $form = $this->renderUploadForm();
     $pageContent = $this->doc->header($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.pagetitle')) . $this->doc->section('', $form);
     // Header Buttons
     $docHeaderButtons = array('csh' => BackendUtility::cshItem('xMOD_csh_corebe', 'file_upload'), 'back' => '');
     $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => '', 'CONTENT' => $pageContent, 'PATH' => $this->title);
     // Back
     if ($this->returnUrl) {
         $docHeaderButtons['back'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', true) . '">' . $this->iconFactory->getIcon('actions-view-go-back', Icon::SIZE_SMALL)->render() . '</a>';
     }
     $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
     $this->content .= $this->doc->endPage();
     $this->content = $this->doc->insertStylesAndJS($this->content);
 }
 /**
  * Main function, rendering the upload file form fields
  *
  * @return void
  */
 public function main()
 {
     $lang = $this->getLanguageService();
     // set page title
     $this->moduleTemplate->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.pagetitle'));
     $pageContent = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_file')) . '" method="post" id="FileUploadController" name="editform" enctype="multipart/form-data">';
     // Make page header:
     $pageContent .= '<h1>' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.pagetitle') . '</h1>';
     $pageContent .= $this->renderUploadForm();
     // Header Buttons
     $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
     // csh button
     $cshButton = $buttonBar->makeHelpButton()->setModuleName('xMOD_csh_corebe')->setFieldName('file_upload');
     $buttonBar->addButton($cshButton);
     // back button
     if ($this->returnUrl) {
         $backButton = $buttonBar->makeLinkButton()->setHref(GeneralUtility::linkThisUrl($this->returnUrl))->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', true))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL));
         $buttonBar->addButton($backButton);
     }
     $pageContent .= '</form>';
     $this->content .= '<div>' . $pageContent . '</div>';
     $this->moduleTemplate->setContent($this->content);
 }
 /**
  * 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' => '', 'view' => '', 'edit' => '', 'hide_unhide' => '', 'move' => '', 'new_record' => '', 'paste' => '', 'level_up' => '', 'cache' => '', 'reload' => '', 'shortcut' => '', 'back' => '', 'csv' => '', 'export' => '');
     // Get users permissions for this page record:
     $localCalcPerms = $GLOBALS['BE_USER']->calcPerms($this->pageRow);
     // CSH
     if (!strlen($this->id)) {
         $buttons['csh'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'list_module_noId', $GLOBALS['BACK_PATH'], '', TRUE);
     } elseif (!$this->id) {
         $buttons['csh'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'list_module_root', $GLOBALS['BACK_PATH'], '', TRUE);
     } else {
         $buttons['csh'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'list_module', $GLOBALS['BACK_PATH'], '', TRUE);
     }
     if (isset($this->id)) {
         // View Exclude doktypes 254,255 Configuration: mod.web_list.noViewWithDokTypes = 254,255
         if (isset($GLOBALS['SOBE']->modTSconfig['properties']['noViewWithDokTypes'])) {
             $noViewDokTypes = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['SOBE']->modTSconfig['properties']['noViewWithDokTypes'], TRUE);
         } else {
             //default exclusion: doktype 254 (folder), 255 (recycler)
             $noViewDokTypes = array(\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SYSFOLDER, \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_RECYCLER);
         }
         if (!in_array($this->pageRow['doktype'], $noViewDokTypes)) {
             $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($this->id, $this->backPath, \TYPO3\CMS\Backend\Utility\BackendUtility::BEgetRootLine($this->id))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-view') . '</a>';
         }
         // New record
         if (!$GLOBALS['SOBE']->modTSconfig['properties']['noCreateRecordsLink']) {
             $buttons['new_record'] = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'' . $this->backPath . 'db_new.php?id=' . $this->id . '\');') . '" title="' . $GLOBALS['LANG']->getLL('newRecordGeneral', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-new') . '</a>';
         }
         // If edit permissions are set (see class.t3lib_userauthgroup.php)
         if ($localCalcPerms & 2 && !empty($this->id)) {
             // Edit
             $params = '&edit[pages][' . $this->pageRow['uid'] . ']=edit';
             $buttons['edit'] = '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick($params, $this->backPath, -1)) . '" title="' . $GLOBALS['LANG']->getLL('editPage', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-page-open') . '</a>';
         }
         // Paste
         if ($localCalcPerms & 8 || $localCalcPerms & 16) {
             $elFromTable = $this->clipObj->elFromTable('');
             if (count($elFromTable)) {
                 $buttons['paste'] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('', $this->id)) . '" onclick="' . htmlspecialchars('return ' . $this->clipObj->confirmMsg('pages', $this->pageRow, 'into', $elFromTable)) . '" title="' . $GLOBALS['LANG']->getLL('clip_paste', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-paste-after') . '</a>';
             }
         }
         // Cache
         $buttons['cache'] = '<a href="' . htmlspecialchars($this->listURL() . '&clear_cache=1') . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.clear_cache', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-system-cache-clear') . '</a>';
         if ($this->table) {
             // CSV
             $buttons['csv'] = '<a href="' . htmlspecialchars($this->listURL() . '&csv=1') . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.csv', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('mimetypes-text-csv') . '</a>';
             // Export
             if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('impexp')) {
                 $url = $this->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('impexp') . 'app/index.php?tx_impexp[action]=export';
                 $buttons['export'] = '<a href="' . htmlspecialchars($url . '&tx_impexp[list][]=' . rawurlencode($this->table . ':' . $this->id)) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.export', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-export-t3d') . '</a>';
             }
         }
         // Reload
         $buttons['reload'] = '<a href="' . htmlspecialchars($this->listURL()) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.reload', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-system-refresh') . '</a>';
         // Shortcut
         if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
             $buttons['shortcut'] = $GLOBALS['TBE_TEMPLATE']->makeShortcutIcon('id, imagemode, pointer, table, search_field, search_levels, showLimit, sortField, sortRev', implode(',', array_keys($this->MOD_MENU)), 'web_list');
         }
         // Back
         if ($this->returnUrl) {
             $buttons['back'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($this->returnUrl, array('id' => $this->id))) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
         }
     }
     return $buttons;
 }
    /**
     * Main function, rendering the main module content
     *
     * @return void
     */
    public function main()
    {
        // Start content compilation
        $this->content .= $this->doc->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.pagetitle'));
        // Make page header:
        $pageContent = $this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.pagetitle'));
        $pageContent .= $this->doc->spacer(5);
        $pageContent .= $this->doc->divider(5);
        if ($this->folderObject->checkActionPermission('add')) {
            $code = '<form action="tce_file.php" 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 id="c-select">
					<label for="number-of-new-folders">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.number_of_folders') . '</label>
					<select 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>
				';
            // Making the number of new-folder boxes needed:
            $code .= '
				<div id="c-createFolders">
			';
            for ($a = 0; $a < $this->number; $a++) {
                $code .= '
						<input' . $this->doc->formWidth(20) . ' type="text" name="file[newfolder][' . $a . '][data]" onchange="changed=true;" />
						<input type="hidden" name="file[newfolder][' . $a . '][target]" value="' . htmlspecialchars($this->target) . '" /><br />
					';
            }
            $code .= '
				</div>
			';
            // Making submit button for folder creation:
            $code .= '
				<div id="c-submitFolders">
					<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.submit', TRUE) . '" />
					<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.cancel', TRUE) . '" onclick="backToList(); return false;" />
					<input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" />
					' . \TYPO3\CMS\Backend\Form\FormEngine::getHiddenTokenField('tceAction') . '
				</div>
				';
            // CSH:
            $code .= BackendUtility::cshItem('xMOD_csh_corebe', 'file_newfolder', $GLOBALS['BACK_PATH'], '<br />');
            $pageContent .= $code;
            // Add spacer:
            $pageContent .= $this->doc->spacer(10);
            // Switching form tags:
            $pageContent .= $this->doc->sectionEnd() . '</form>';
        }
        if ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File')) {
            $pageContent .= '<form action="tce_file.php" 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[] = '*.' . $fileExt;
                }
            }
            // Add form fields for creation of a new, blank text file:
            $code = '
				<div id="c-newFile">
					<p>[' . htmlspecialchars(implode(', ', $fileExtList)) . ']</p>
					<input' . $this->doc->formWidth(20) . ' type="text" name="file[newfile][0][data]" onchange="changed=true;" />
					<input type="hidden" name="file[newfile][0][target]" value="' . htmlspecialchars($this->target) . '" />
				</div>
				';
            // Submit button for creation of a new file:
            $code .= '
				<div id="c-submitFiles">
					<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfile_submit', TRUE) . '" />
					<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.cancel', TRUE) . '" onclick="backToList(); return false;" />
					<input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" />
					' . \TYPO3\CMS\Backend\Form\FormEngine::getHiddenTokenField('tceAction') . '
				</div>
				';
            // CSH:
            $code .= BackendUtility::cshItem('xMOD_csh_corebe', 'file_newfile', $GLOBALS['BACK_PATH'], '<br />');
            $pageContent .= $this->doc->section($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfile'), $code);
            $pageContent .= $this->doc->sectionEnd();
            $pageContent .= '</form>';
        }
        $docHeaderButtons = array('back' => '');
        // Back
        if ($this->returnUrl) {
            $docHeaderButtons['back'] = '<a href="' . htmlspecialchars(GeneralUtility::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
        }
        // Add the HTML as a section:
        $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $pageContent, 'PATH' => $this->title);
        $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
        $this->content .= $this->doc->endPage();
        $this->content = $this->doc->insertStylesAndJS($this->content);
    }
示例#5
0
    /**
     * [Describe function...]
     *
     * @param array $row
     * @param array $conf
     * @param string $table
     * @return string
     * @todo Define visibility
     */
    public function resultRowDisplay($row, $conf, $table)
    {
        static $even = FALSE;
        $tce = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
        $SET = $GLOBALS['SOBE']->MOD_SETTINGS;
        $out = '<tr class="bgColor' . ($even ? '6' : '4') . '">';
        $even = !$even;
        foreach ($row as $fN => $fV) {
            if (GeneralUtility::inList($SET['queryFields'], $fN) || !$SET['queryFields'] && $fN != 'pid' && $fN != 'deleted') {
                if ($SET['search_result_labels']) {
                    $fVnew = $this->getProcessedValueExtra($table, $fN, $fV, $conf, '<br />');
                } else {
                    $fVnew = htmlspecialchars($fV);
                }
                $out .= '<td>' . $fVnew . '</td>';
            }
        }
        $params = '&edit[' . $table . '][' . $row['uid'] . ']=edit';
        $out .= '<td nowrap>';
        if (!$row['deleted']) {
            $out .= '<a href="#" onClick="top.launchView(\'' . $table . '\',' . $row['uid'] . ',\'' . $GLOBALS['BACK_PATH'] . '\');return false;">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-dialog-information') . '</a>';
            $out .= '<a href="#" onClick="' . BackendUtility::editOnClick($params, $GLOBALS['BACK_PATH'], GeneralUtility::getIndpEnv('REQUEST_URI') . GeneralUtility::implodeArrayForUrl('SET', (array) GeneralUtility::_POST('SET'))) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-open') . '</a>';
        } else {
            $out .= '<a href="' . GeneralUtility::linkThisUrl($GLOBALS['BACK_PATH'] . 'tce_db.php', array('cmd[' . $table . '][' . $row['uid'] . '][undelete]' => '1', 'redirect' => GeneralUtility::linkThisScript(array()))) . BackendUtility::getUrlToken('tceAction') . '">';
            $out .= \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-restore', array('title' => 'undelete only')) . '</a>';
            $out .= '<a href="' . GeneralUtility::linkThisUrl($GLOBALS['BACK_PATH'] . 'tce_db.php', array('cmd[' . $table . '][' . $row['uid'] . '][undelete]' => '1', 'redirect' => GeneralUtility::linkThisUrl('alt_doc.php', array('edit[' . $table . '][' . $row['uid'] . ']' => 'edit', 'returnUrl' => GeneralUtility::linkThisScript(array()))))) . BackendUtility::getUrlToken('tceAction') . '">';
            $out .= \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-restore-edit', array('title' => 'undelete and edit')) . '</a>';
        }
        $_params = array($table => $row);
        if (is_array($this->hookArray['additionalButtons'])) {
            foreach ($this->hookArray['additionalButtons'] as $_funcRef) {
                $out .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
            }
        }
        $out .= '</td>
		</tr>
		';
        return $out;
    }
示例#6
0
    /**
     * Result row display
     *
     * @param array $row
     * @param array $conf
     * @param string $table
     * @return string
     */
    public function resultRowDisplay($row, $conf, $table)
    {
        $SET = $GLOBALS['SOBE']->MOD_SETTINGS;
        $out = '<tr>';
        foreach ($row as $fieldName => $fieldValue) {
            if (GeneralUtility::inList($SET['queryFields'], $fieldName) || !$SET['queryFields'] && $fieldName != 'pid' && $fieldName != 'deleted') {
                if ($SET['search_result_labels']) {
                    $fVnew = $this->getProcessedValueExtra($table, $fieldName, $fieldValue, $conf, '<br />');
                } else {
                    $fVnew = htmlspecialchars($fieldValue);
                }
                $out .= '<td>' . $fVnew . '</td>';
            }
        }
        $out .= '<td><div class="btn-group">';
        if (!$row['deleted']) {
            $url = BackendUtility::getModuleUrl('record_edit', ['edit' => [$table => [$row['uid'] => 'edit']], 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') . GeneralUtility::implodeArrayForUrl('SET', (array) GeneralUtility::_POST('SET'))]);
            $out .= '<a class="btn btn-default" href="#" onClick="top.launchView(\'' . $table . '\',' . $row['uid'] . ');return false;">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL)->render() . '</a>';
            $out .= '<a class="btn btn-default" href="' . htmlspecialchars($url) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
        } else {
            $out .= '<a class="btn btn-default" href="' . GeneralUtility::linkThisUrl(BackendUtility::getModuleUrl('tce_db'), array('cmd[' . $table . '][' . $row['uid'] . '][undelete]' => '1', 'redirect' => GeneralUtility::linkThisScript(array()))) . '" title="' . $GLOBALS['LANG']->getLL('undelete_only', true) . '">';
            $out .= $this->iconFactory->getIcon('actions-edit-restore', Icon::SIZE_SMALL)->render() . '</a>';
            $formEngineParameters = array('edit[' . $table . '][' . $row['uid'] . ']' => 'edit', 'returnUrl' => GeneralUtility::linkThisScript(array()));
            $redirectUrl = BackendUtility::getModuleUrl('record_edit', $formEngineParameters);
            $out .= '<a class="btn btn-default" href="' . GeneralUtility::linkThisUrl(BackendUtility::getModuleUrl('tce_db'), array('cmd[' . $table . '][' . $row['uid'] . '][undelete]' => '1', 'redirect' => $redirectUrl)) . '" title="' . $GLOBALS['LANG']->getLL('undelete_and_edit', true) . '">';
            $out .= $this->iconFactory->getIcon('actions-edit-restore-edit', Icon::SIZE_SMALL)->render() . '</a>';
        }
        $_params = array($table => $row);
        if (is_array($this->hookArray['additionalButtons'])) {
            foreach ($this->hookArray['additionalButtons'] as $_funcRef) {
                $out .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
            }
        }
        $out .= '</div></td>
		</tr>
		';
        return $out;
    }
    /**
     * Main function, rendering the main module content
     *
     * @return void
     */
    public function main()
    {
        $lang = $this->getLanguageService();
        $pageContent = '<h1>' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.pagetitle') . '</h1>';
        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 = 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') . '</label> ' . BackendUtility::cshItem('xMOD_csh_corebe', 'file_newfolder') . '
							<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) . '" />
				</div>
				';
            // Switching form tags:
            $pageContent .= '<h3>' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfolders', true) . '</h3>';
            $pageContent .= '<div>' . $code . '</form></div>';
        }
        if ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File')) {
            $pageContent .= '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('online_media')) . '" method="post" name="editform2">';
            // Create a list of allowed file extensions with the readable format "youtube, vimeo" etc.
            $fileExtList = array();
            $onlineMediaFileExt = OnlineMediaHelperRegistry::getInstance()->getSupportedFileExtensions();
            foreach ($onlineMediaFileExt as $fileExt) {
                if (GeneralUtility::verifyFilenameAgainstDenyPattern($fileExt)) {
                    $fileExtList[] = '<span class="label label-success">' . strtoupper(htmlspecialchars($fileExt)) . '</span>';
                }
            }
            // Add form fields for adding media files:
            $code = '
				<div class="form-group">
					<div class="form-section">
						<div class="form-group">
							<label for="newMedia">' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.label', true) . '</label> ' . BackendUtility::cshItem('xMOD_csh_corebe', 'file_newMedia') . '
							<div class="form-control-wrap">
								<input class="form-control" type="text" id="newMedia" name="file[newMedia][0][url]"
									placeholder="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.placeholder', true) . '" />
								<input type="hidden" name="file[newMedia][0][target]" value="' . htmlspecialchars($this->target) . '" />
							</div>
							<div class="help-block">
								' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.allowedProviders', true) . '<br>
								' . implode(' ', $fileExtList) . '
							</div>
						</div>
					</div>
				</div>
				';
            // Submit button for creation of a new media:
            $code .= '
				<div class="form-group">
					<input class="btn btn-default" type="submit" value="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.submit', true) . '" />
					<input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" />
				</div>
				';
            $pageContent .= '<h3>' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media', true) . '</h3>';
            $pageContent .= '<div>' . $code . '</div>';
            $pageContent .= '</form>';
            $pageContent .= '<form action="' . BackendUtility::getModuleUrl('tce_file') . '" method="post" name="editform3">';
            // 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 (GeneralUtility::verifyFilenameAgainstDenyPattern($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', true) . '</label> ' . BackendUtility::cshItem('xMOD_csh_corebe', 'file_newfile') . '
							<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', true) . '<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) . '" />
				</div>
			';
            $pageContent .= '<h3>' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfile', true) . '</h3>';
            $pageContent .= '<div>' . $code . '</div>';
            $pageContent .= '</form>';
        }
        $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
        // Back
        if ($this->returnUrl) {
            $backButton = $buttonBar->makeLinkButton()->setHref(GeneralUtility::linkThisUrl($this->returnUrl))->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL));
            $buttonBar->addButton($backButton);
        }
        $this->content .= '<div>' . $pageContent . '</div>';
        $this->moduleTemplate->setContent($this->content);
    }
示例#8
0
    /**
     * Writes the top of the full listing
     *
     * @param array $row Current page record
     *
     * @return void
     */
    public function writeTop(array $row)
    {
        $language = $this->getLanguageService();
        $backendUser = $this->getBackendUser();
        // Makes the code for the pageicon in the top
        $this->pageRow = $row;
        $this->counter++;
        $alttext = BackendUtility::getRecordIconAltText($row, 'pages');
        $iconImg = IconUtility::skinImg($this->backPath, IconUtility::getIcon('pages', $row), 'class="absmiddle" title="' . htmlspecialchars($alttext) . '"');
        // pseudo title column name
        $titleCol = 'test';
        // Setting the fields to display in the list
        // (this is of course "pseudo fields" since this is the top!)
        $this->fieldArray = array($titleCol, 'up');
        // Filling in the pseudo data array:
        $theData = array();
        $theData[$titleCol] = $this->widthGif;
        // Get users permissions for this row:
        $localCalcPerms = $backendUser->calcPerms($row);
        $theData['up'] = array();
        // Initialize control panel for currect page ($this->id):
        // Some of the controls are added only if $this->id is set
        // - since they make sense only on a real page, not root level.
        $theCtrlPanel = array();
        // If edit permissions are set
        if ($localCalcPerms & 2) {
            // Adding "New record" icon:
            if (!$GLOBALS['SOBE']->modTSconfig['properties']['noCreateRecordsLink']) {
                $theCtrlPanel[] = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'db_new.php?id=' . $this->id . '\');') . '">' . IconUtility::getSpriteIcon('actions-document-new', array('title' => $language->getLL('newRecordGeneral', 1))) . '</a>';
            }
            // Adding "Hide/Unhide" icon:
            if ($this->id) {
                // @todo: change the return path
                if ($row['hidden']) {
                    $params = '&data[pages][' . $row['uid'] . '][hidden]=0';
                    $theCtrlPanel[] = '<a href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '">' . IconUtility::getSpriteIcon('actions-edit-unhide', array('title' => $language->getLL('unHidePage', 1))) . '</a>';
                } else {
                    $params = '&data[pages][' . $row['uid'] . '][hidden]=1';
                    $theCtrlPanel[] = '<a href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '">' . IconUtility::getSpriteIcon('actions-edit-hide', array('title' => $language->getLL('hidePage', 1))) . '</a>';
                }
            }
        }
        // "Paste into page" link:
        if ($localCalcPerms & 8 || $localCalcPerms & 16) {
            $elFromTable = $this->clipObj->elFromTable('');
            if (count($elFromTable)) {
                $theCtrlPanel[] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('', $this->id)) . '" onclick="' . htmlspecialchars('return ' . $this->clipObj->confirmMsg('pages', $this->pageRow, 'into', $elFromTable)) . '">' . IconUtility::getSpriteIcon('actions-document-paste-into', array('title' => $language->getLL('clip_paste', 1))) . '</a>';
            }
        }
        // Finally, compile all elements of the control panel into table cells:
        if (count($theCtrlPanel)) {
            $theData['up'][] = '

				<!--
					Control panel for page
				-->
				<table border="0" cellpadding="0" cellspacing="0" class="bgColor4" id="typo3-dblist-ctrltop">
					<tr>
						<td>' . implode('</td><td>', $theCtrlPanel) . '</td>
					</tr>
				</table>';
        }
        // Add "CSV" link, if a specific table is shown:
        if ($this->table) {
            $theData['up'][] = '<a href="' . htmlspecialchars($this->listURL() . '&csv=1') . '">' . IconUtility::getSpriteIcon('mimetypes-text-csv', array('title' => $language->sL('LLL:EXT:lang/locallang_core.php:labels.csv', 1))) . '</a>';
        }
        // Add "Export" link, if a specific table is shown:
        if ($this->table && ExtensionManagementUtility::isLoaded('impexp')) {
            $theData['up'][] = '<a href="' . htmlspecialchars($this->backPath . ExtensionManagementUtility::extRelPath('impexp') . 'app/index.php?tx_impexp[action]=export&tx_impexp[list][]=' . rawurlencode($this->table . ':' . $this->id)) . '">' . IconUtility::getSpriteIcon('actions-document-export-t3d', array('title' => $language->sL('LLL:EXT:lang/locallang_core.php:rm.export', 1))) . '</a>';
        }
        // Add "refresh" link:
        $theData['up'][] = '<a href="' . htmlspecialchars($this->listURL()) . '">' . IconUtility::getSpriteIcon('actions-system-refresh', array('title' => $language->sL('LLL:EXT:lang/locallang_core.php:labels.reload', 1))) . '</a>';
        // Add icon with clickmenu, etc:
        // If there IS a real page...:
        if ($this->id) {
            // Setting title of page + the "Go up" link:
            $theData[$titleCol] .= '<br /><span title="' . htmlspecialchars($row['_thePathFull']) . '">' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['_thePath'], -$this->fixedL)) . '</span>';
            $theData['up'][] = '<a href="' . htmlspecialchars($this->listURL($row['pid'])) . '" onclick="setHighlight(' . $row['pid'] . ')">' . IconUtility::getSpriteIcon('actions-view-go-up', array('title' => $language->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel', 1))) . '</a>';
            // Make Icon:
            if ($this->clickMenuEnabled) {
                $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', $this->id);
            } else {
                $theIcon = $iconImg;
            }
            // On root-level of page tree:
        } else {
            // Setting title of root (sitename):
            $theData[$titleCol] .= '<br />' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'], -$this->fixedL));
            // Make Icon:
            $theIcon = IconUtility::getSpriteIcon('apps-pagetree-root');
        }
        // If there is a returnUrl given, add a back-link:
        if ($this->returnUrl) {
            $theData['up'][] = '<a href="' . htmlspecialchars(GeneralUtility::linkThisUrl($this->returnUrl, array('id' => $this->id))) . '" class="typo3-goBack">' . IconUtility::getSpriteIcon('actions-view-go-back', array('title' => $language->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', 1))) . '</a>';
        }
        // Finally, the "up" pseudo field is compiled into a table
        // - has been accumulated in an array:
        $theData['up'] = '
			<table border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td>' . implode('</td><td>', $theData['up']) . '</td>
				</tr>
			</table>';
        // ... and the element row is created:
        $out = $this->addelement(1, $theIcon, $theData, '', $this->leftMargin);
        // ... and wrapped into a table and added to the internal ->HTMLcode variable:
        $this->HTMLcode .= '
			<!--
				Page header for db_list:
			-->
			<table border="0" cellpadding="0" cellspacing="0" id="typo3-dblist-top">
				' . $out . '
			</table>';
    }
 /**
  * Returns the select-url for database elements
  *
  * @param string $table Table name
  * @param integer $uid Uid of record
  * @param integer $pid Pid of record
  * @param boolean $copy If set, copymode will be enabled
  * @param boolean $deselect If set, the link will deselect, otherwise select.
  * @param array $baseArray The base array of GET vars to be sent in addition. Notice that current GET vars WILL automatically be included.
  * @return string URL linking to the current script but with the CB array set to select the element with table/uid
  */
 function selUrlDB($table, $uid, $pid, $copy = 0, $deselect = 0, $baseArray = array())
 {
     $CB = array('el' => array(rawurlencode($table . '|' . $uid) => $deselect ? 0 : 1));
     if ($copy) {
         $CB['setCopyMode'] = 1;
     }
     $baseArray['M'] = 'web_list';
     $baseArray['id'] = $pid;
     $baseArray['CB'] = $CB;
     unset($baseArray['returnUrl']);
     $moduleUrl = BackendUtility::getModuleUrl('web_list');
     return GeneralUtility::linkThisUrl($moduleUrl, $baseArray);
 }
    /**
     * Main function, rendering the content of the rename form
     *
     * @return void
     */
    public function main()
    {
        // Make page header:
        $this->content = $this->doc->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.pagetitle'));
        $pageContent = $this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.pagetitle'));
        $pageContent .= $this->doc->spacer(5);
        $pageContent .= $this->doc->divider(5);
        if ($this->fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\Folder) {
            $fileIdentifier = $this->fileOrFolderObject->getCombinedIdentifier();
        } else {
            $fileIdentifier = $this->fileOrFolderObject->getUid();
        }
        $code = '<form action="tce_file.php" method="post" name="editform">';
        // Making the formfields for renaming:
        $code .= '

			<div id="c-rename">
				<input type="text" name="file[rename][0][target]" value="' . htmlspecialchars($this->fileOrFolderObject->getName()) . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(40) . ' />
				<input type="hidden" name="file[rename][0][data]" value="' . htmlspecialchars($fileIdentifier) . '" />
			</div>
		';
        // Making submit button:
        $code .= '
			<div id="c-submit">
				<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.submit', TRUE) . '" />
				<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.cancel', TRUE) . '" onclick="backToList(); return false;" />
				<input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" />
				' . \TYPO3\CMS\Backend\Form\FormEngine::getHiddenTokenField('tceAction') . '
			</div>
		';
        $code .= '</form>';
        // Add the HTML as a section:
        $pageContent .= $code;
        $docHeaderButtons = array('back' => '');
        $docHeaderButtons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'file_rename', $GLOBALS['BACK_PATH']);
        // Back
        if ($this->returnUrl) {
            $docHeaderButtons['back'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
        }
        // Add the HTML as a section:
        $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $pageContent, 'PATH' => $this->title);
        $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
        $this->content .= $this->doc->endPage();
        $this->content = $this->doc->insertStylesAndJS($this->content);
    }
示例#11
0
 /**
  * Create the panel of buttons for submitting the form or otherwise perform operations.
  *
  * @return	array		all available buttons as an assoc. array
  */
 function getHeaderButtons()
 {
     global $LANG;
     $buttons = array('csh' => '', 'view' => '', 'edit' => '', 'record_list' => '', 'level_up' => '', 'reload' => '', 'shortcut' => '', 'back' => '', 'csv' => '', 'export' => '');
     $backPath = $GLOBALS['BACK_PATH'];
     // CSH
     // 		if (!strlen($this->id))	{
     // 			$buttons['csh'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('_MOD_web_txttnewsM1', 'list_module_noId', $backPath);
     // 		} elseif(!$this->id) {
     // 			$buttons['csh'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('_MOD_web_txttnewsM1', 'list_module_root', $backPath);
     // 		} else {
     // 			$buttons['csh'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('_MOD_web_txttnewsM1', 'list_module', $backPath);
     // 		}
     if (isset($this->id)) {
         if ($GLOBALS['BE_USER']->check('modules', 'web_list')) {
             $href = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_list', array('id' => $this->pageinfo['uid'], 'returnUrl' => \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI')));
             $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '">' . '<img' . IconUtility::skinImg($backPath, 'gfx/list.gif', 'width="11" height="11"') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1) . '" alt="" />' . '</a>';
         }
         // View
         $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($this->id, $backPath, \TYPO3\CMS\Backend\Utility\BackendUtility::BEgetRootLine($this->id))) . '">' . '<img' . IconUtility::skinImg($backPath, 'gfx/zoom.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '" alt="" />' . '</a>';
         // If edit permissions are set (see class.t3lib_userauthgroup.php)
         if ($this->localCalcPerms & 2 && !empty($this->id)) {
             // Edit
             $params = '&edit[pages][' . $this->pageinfo['uid'] . ']=edit';
             $buttons['edit'] = '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick($params, $backPath, -1)) . '">' . '<img' . IconUtility::skinImg($backPath, 'gfx/edit2.gif') . ' title="' . $LANG->getLL('editPage', 1) . '" alt="" />' . '</a>';
         }
         //			if ($this->table) {
         // Export
         //				if (TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('impexp')) {
         //					$modUrl = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('impexp') . 'app/index.php';
         //					$params = $modUrl . '?tx_impexp[action]=export&tx_impexp[list][]=';
         //					$params .= rawurlencode('tt_news:' . $this->id).'&tx_impexp[list][]=';
         //					$params .= rawurlencode('tt_news_cat:' . $this->id);
         //					$buttons['export'] = '<a href="' . htmlspecialchars($backPath.$params).'">' .
         //									'<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($backPath, TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('impexp') . 'export.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.export', 1) . '" alt="" />' .
         //									'</a>';
         //				}
         //			}
         // Reload
         $buttons['reload'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript()) . '">' . '<img' . IconUtility::skinImg($backPath, 'gfx/refresh_n.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.reload', 1) . '" alt="" />' . '</a>';
         // Shortcut
         if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
             $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, showThumbs, pointer, table, search_field, searchLevels, showLimit, sortField, sortRev', implode(',', array_keys($this->MOD_MENU)), 'web_txttnewsM1');
         }
         // Back
         if ($this->returnUrl) {
             $buttons['back'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($this->returnUrl, array('id' => $this->id))) . '" class="typo3-goBack">' . '<img' . IconUtility::skinImg($backPath, 'gfx/goback.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', 1) . '" alt="" />' . '</a>';
         }
     }
     return $buttons;
 }
 /**
  * Main function, rendering the upload file form fields
  *
  * @return void
  */
 public function main()
 {
     $lang = $this->getLanguageService();
     // set page title
     $this->moduleTemplate->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.pagetitle'));
     // Make page header:
     $pageContent = '<h1>' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.pagetitle') . '</h1>';
     $pageContent .= $this->renderUploadForm();
     // Header Buttons
     $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
     // csh button
     $cshButton = $buttonBar->makeHelpButton()->setModuleName('xMOD_csh_corebe')->setFieldName('file_upload');
     $buttonBar->addButton($cshButton);
     // back button
     if ($this->returnUrl) {
         $backButton = $buttonBar->makeLinkButton()->setHref(GeneralUtility::linkThisUrl($this->returnUrl))->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', true))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL));
         $buttonBar->addButton($backButton);
     }
     $this->content .= $this->moduleTemplate->section('', $pageContent);
     $this->moduleTemplate->setContent($this->content);
 }
示例#13
0
    /**
     * Result row display
     *
     * @param array $row
     * @param array $conf
     * @param string $table
     * @return string
     */
    public function resultRowDisplay($row, $conf, $table)
    {
        $SET = $GLOBALS['SOBE']->MOD_SETTINGS;
        $out = '<tr>';
        foreach ($row as $fieldName => $fieldValue) {
            if (GeneralUtility::inList($SET['queryFields'], $fieldName) || !$SET['queryFields'] && $fieldName != 'pid' && $fieldName != 'deleted') {
                if ($SET['search_result_labels']) {
                    $fVnew = $this->getProcessedValueExtra($table, $fieldName, $fieldValue, $conf, '<br />');
                } else {
                    $fVnew = htmlspecialchars($fieldValue);
                }
                $out .= '<td>' . $fVnew . '</td>';
            }
        }
        $params = '&edit[' . $table . '][' . $row['uid'] . ']=edit';
        $out .= '<td><div class="btn-group">';
        if (!$row['deleted']) {
            $out .= '<a class="btn btn-default" href="#" onClick="top.launchView(\'' . $table . '\',' . $row['uid'] . ',\'' . $GLOBALS['BACK_PATH'] . '\');return false;">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-dialog-information') . '</a>';
            $out .= '<a class="btn btn-default" href="#" onClick="' . htmlspecialchars(BackendUtility::editOnClick($params, '', GeneralUtility::getIndpEnv('REQUEST_URI') . GeneralUtility::implodeArrayForUrl('SET', (array) GeneralUtility::_POST('SET')))) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-open') . '</a>';
        } else {
            $out .= '<a class="btn btn-default" href="' . GeneralUtility::linkThisUrl(BackendUtility::getModuleUrl('tce_db'), array('cmd[' . $table . '][' . $row['uid'] . '][undelete]' => '1', 'redirect' => GeneralUtility::linkThisScript(array()))) . BackendUtility::getUrlToken('tceAction') . '">';
            $out .= \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-restore', array('title' => 'undelete only')) . '</a>';
            $formEngineParameters = array('edit[' . $table . '][' . $row['uid'] . ']' => 'edit', 'returnUrl' => GeneralUtility::linkThisScript(array()));
            $redirectUrl = BackendUtility::getModuleUrl('record_edit', $formEngineParameters);
            $out .= '<a class="btn btn-default" href="' . GeneralUtility::linkThisUrl(BackendUtility::getModuleUrl('tce_db'), array('cmd[' . $table . '][' . $row['uid'] . '][undelete]' => '1', 'redirect' => $redirectUrl)) . BackendUtility::getUrlToken('tceAction') . '">';
            $out .= \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-restore-edit', array('title' => 'undelete and edit')) . '</a>';
        }
        $_params = array($table => $row);
        if (is_array($this->hookArray['additionalButtons'])) {
            foreach ($this->hookArray['additionalButtons'] as $_funcRef) {
                $out .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
            }
        }
        $out .= '</div></td>
		</tr>
		';
        return $out;
    }
示例#14
0
    /**
     * Main function, rendering the content of the rename form
     *
     * @return void
     */
    public function main()
    {
        // Make page header:
        $this->content = $this->doc->startPage($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.pagetitle'));
        $pageContent = $this->doc->header($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.pagetitle'));
        if ($this->fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\Folder) {
            $fileIdentifier = $this->fileOrFolderObject->getCombinedIdentifier();
        } else {
            $fileIdentifier = $this->fileOrFolderObject->getUid();
        }
        $pageContent .= '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_file')) . '" method="post" name="editform" role="form">';
        // Making the formfields for renaming:
        $pageContent .= '

			<div class="form-group">
				<input class="form-control" type="text" name="file[rename][0][target]" value="' . htmlspecialchars($this->fileOrFolderObject->getName()) . '" ' . $this->getDocumentTemplate()->formWidth(40) . ' />
				<input type="hidden" name="file[rename][0][data]" value="' . htmlspecialchars($fileIdentifier) . '" />
			</div>
		';
        // Making submit button:
        $pageContent .= '
			<div class="form-group">
				<input class="btn btn-primary" type="submit" value="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.submit', TRUE) . '" />
				<input class="btn btn-danger" type="submit" value="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.cancel', TRUE) . '" onclick="backToList(); return false;" />
				<input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" />
				' . \TYPO3\CMS\Backend\Form\FormEngine::getHiddenTokenField('tceAction') . '
			</div>
		';
        $pageContent .= '</form>';
        $docHeaderButtons = array('back' => '');
        $docHeaderButtons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'file_rename');
        // Back
        if ($this->returnUrl) {
            $docHeaderButtons['back'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
        }
        // Add the HTML as a section:
        $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => '', 'CONTENT' => $pageContent, 'PATH' => $this->title);
        $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
        $this->content .= $this->doc->endPage();
        $this->content = $this->doc->insertStylesAndJS($this->content);
    }
示例#15
0
    /**
     * Main function, rendering the content of the rename form
     *
     * @return void
     */
    public function main()
    {
        if ($this->fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\Folder) {
            $fileIdentifier = $this->fileOrFolderObject->getCombinedIdentifier();
        } else {
            $fileIdentifier = $this->fileOrFolderObject->getUid();
        }
        $pageContent = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_file')) . '" method="post" name="editform" role="form">';
        // Making the formfields for renaming:
        $pageContent .= '

			<div class="form-group">
				<input class="form-control" type="text" name="file[rename][0][target]" value="' . htmlspecialchars($this->fileOrFolderObject->getName()) . '" ' . $this->getDocumentTemplate()->formWidth(40) . ' />
				<input type="hidden" name="file[rename][0][data]" value="' . htmlspecialchars($fileIdentifier) . '" />
			</div>
		';
        // Making submit button:
        $pageContent .= '
			<div class="form-group">
				<input class="btn btn-primary" type="submit" value="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.submit', true) . '" />
				<input class="btn btn-danger" type="submit" value="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.cancel', true) . '" onclick="backToList(); return false;" />
				<input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" />
			</div>
		';
        $pageContent .= '</form>';
        // Create buttons
        $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
        // csh button
        $cshButton = $buttonBar->makeHelpButton()->setModuleName('xMOD_csh_corebe')->setFieldName('file_rename');
        $buttonBar->addButton($cshButton);
        // back button
        if ($this->returnUrl) {
            $backButton = $buttonBar->makeLinkButton()->sethref(GeneralUtility::linkThisUrl($this->returnUrl))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', true))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL));
            $buttonBar->addButton($backButton);
        }
        // set header
        $this->content = '<h1>' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.pagetitle') . '</h1>';
        // add section
        $this->content .= $this->moduleTemplate->section('', $pageContent);
        $this->moduleTemplate->setContent($this->content);
    }
示例#16
0
 /**
  * Create the panel of buttons for submitting the form or otherwise perform
  * operations.
  *
  * @return string[] All available buttons as an assoc. array
  */
 public function getButtons()
 {
     $module = $this->getModule();
     $backendUser = $this->getBackendUserAuthentication();
     $lang = $this->getLanguageService();
     $buttons = array('csh' => '', 'view' => '', 'edit' => '', 'hide_unhide' => '', 'move' => '', 'new_record' => '', 'paste' => '', 'level_up' => '', 'cache' => '', 'reload' => '', 'shortcut' => '', 'back' => '', 'csv' => '', 'export' => '');
     // Get users permissions for this page record:
     $localCalcPerms = $backendUser->calcPerms($this->pageRow);
     // CSH
     if ((string) $this->id === '') {
         $buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'list_module_noId');
     } elseif (!$this->id) {
         $buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'list_module_root');
     } else {
         $buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'list_module');
     }
     if (isset($this->id)) {
         // View Exclude doktypes 254,255 Configuration:
         // mod.web_list.noViewWithDokTypes = 254,255
         if (isset($module->modTSconfig['properties']['noViewWithDokTypes'])) {
             $noViewDokTypes = GeneralUtility::trimExplode(',', $module->modTSconfig['properties']['noViewWithDokTypes'], TRUE);
         } else {
             //default exclusion: doktype 254 (folder), 255 (recycler)
             $noViewDokTypes = array(PageRepository::DOKTYPE_SYSFOLDER, PageRepository::DOKTYPE_RECYCLER);
         }
         if (!in_array($this->pageRow['doktype'], $noViewDokTypes)) {
             $onClick = htmlspecialchars(BackendUtility::viewOnClick($this->id, $this->backPath, BackendUtility::BEgetRootLine($this->id)));
             $buttons['view'] = '<a href="#" onclick="' . $onClick . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
         }
         // New record
         if (!$module->modTSconfig['properties']['noCreateRecordsLink']) {
             $onClick = htmlspecialchars('return jumpExt(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('db_new', ['id' => $this->id])) . ');');
             $buttons['new_record'] = '<a href="#" onclick="' . $onClick . '" title="' . $lang->getLL('newRecordGeneral', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-new') . '</a>';
         }
         // If edit permissions are set, see
         // \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
         if ($localCalcPerms & Permission::PAGE_EDIT && !empty($this->id)) {
             // Edit
             $params = '&edit[pages][' . $this->pageRow['uid'] . ']=edit';
             $onClick = htmlspecialchars(BackendUtility::editOnClick($params, '', -1));
             $buttons['edit'] = '<a href="#" onclick="' . $onClick . '" title="' . $lang->getLL('editPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-page-open') . '</a>';
         }
         // Paste
         if ($localCalcPerms & Permission::PAGE_NEW || $localCalcPerms & Permission::CONTENT_EDIT) {
             $elFromTable = $this->clipObj->elFromTable('');
             if (count($elFromTable)) {
                 $onClick = htmlspecialchars('return ' . $this->clipObj->confirmMsg('pages', $this->pageRow, 'into', $elFromTable));
                 $buttons['paste'] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('', $this->id)) . '" onclick="' . $onClick . '" title="' . $lang->getLL('clip_paste', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-paste-after') . '</a>';
             }
         }
         // Cache
         $buttons['cache'] = '<a href="' . htmlspecialchars($this->listURL() . '&clear_cache=1') . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.clear_cache', TRUE) . '">' . IconUtility::getSpriteIcon('actions-system-cache-clear') . '</a>';
         if ($this->table && (!isset($module->modTSconfig['properties']['noExportRecordsLinks']) || isset($module->modTSconfig['properties']['noExportRecordsLinks']) && !$module->modTSconfig['properties']['noExportRecordsLinks'])) {
             // CSV
             $buttons['csv'] = '<a href="' . htmlspecialchars($this->listURL() . '&csv=1') . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.csv', TRUE) . '">' . IconUtility::getSpriteIcon('mimetypes-text-csv') . '</a>';
             // Export
             if (ExtensionManagementUtility::isLoaded('impexp')) {
                 $url = BackendUtility::getModuleUrl('xMOD_tximpexp', array('tx_impexp[action]' => 'export'));
                 $buttons['export'] = '<a href="' . htmlspecialchars($url . '&tx_impexp[list][]=' . rawurlencode($this->table . ':' . $this->id)) . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.export', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-export-t3d') . '</a>';
             }
         }
         // Reload
         $buttons['reload'] = '<a href="' . htmlspecialchars($this->listURL()) . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.reload', TRUE) . '">' . IconUtility::getSpriteIcon('actions-system-refresh') . '</a>';
         // Shortcut
         if ($backendUser->mayMakeShortcut()) {
             $buttons['shortcut'] = $this->getDocumentTemplate()->makeShortcutIcon('id, imagemode, pointer, table, search_field, search_levels, showLimit, sortField, sortRev', implode(',', array_keys($this->MOD_MENU)), 'web_list');
         }
         // Back
         if ($this->returnUrl) {
             $href = htmlspecialchars(GeneralUtility::linkThisUrl($this->returnUrl, array('id' => $this->id)));
             $buttons['back'] = '<a href="' . $href . '" class="typo3-goBack" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
         }
     }
     return $buttons;
 }
示例#17
0
 /**
  * Create the panel of buttons for submitting the form or otherwise perform
  * operations.
  *
  * @param ModuleTemplate $moduleTemplate
  */
 public function getDocHeaderButtons(ModuleTemplate $moduleTemplate)
 {
     $buttonBar = $moduleTemplate->getDocHeaderComponent()->getButtonBar();
     $module = $this->getModule();
     $backendUser = $this->getBackendUserAuthentication();
     $lang = $this->getLanguageService();
     // Get users permissions for this page record:
     $localCalcPerms = $backendUser->calcPerms($this->pageRow);
     // CSH
     if ((string) $this->id === '') {
         $fieldName = 'list_module_noId';
     } elseif (!$this->id) {
         $fieldName = 'list_module_root';
     } else {
         $fieldName = 'list_module';
     }
     $cshButton = $buttonBar->makeHelpButton()->setModuleName('xMOD_csh_corebe')->setFieldName($fieldName);
     $buttonBar->addButton($cshButton);
     if (isset($this->id)) {
         // View Exclude doktypes 254,255 Configuration:
         // mod.web_list.noViewWithDokTypes = 254,255
         if (isset($module->modTSconfig['properties']['noViewWithDokTypes'])) {
             $noViewDokTypes = GeneralUtility::trimExplode(',', $module->modTSconfig['properties']['noViewWithDokTypes'], true);
         } else {
             //default exclusion: doktype 254 (folder), 255 (recycler)
             $noViewDokTypes = array(PageRepository::DOKTYPE_SYSFOLDER, PageRepository::DOKTYPE_RECYCLER);
         }
         // New record on pages that are not locked by editlock
         if (!$module->modTSconfig['properties']['noCreateRecordsLink'] && $this->editLockPermissions()) {
             $onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('db_new', ['id' => $this->id])) . ');';
             $newRecordButton = $buttonBar->makeLinkButton()->setHref('#')->setOnClick($onClick)->setTitle($lang->getLL('newRecordGeneral', true))->setIcon($this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL));
             $buttonBar->addButton($newRecordButton, ButtonBar::BUTTON_POSITION_LEFT, 10);
         }
         if (!in_array($this->pageRow['doktype'], $noViewDokTypes)) {
             $onClick = BackendUtility::viewOnClick($this->id, '', BackendUtility::BEgetRootLine($this->id));
             $viewButton = $buttonBar->makeLinkButton()->setHref('#')->setOnClick($onClick)->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true))->setIcon($this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL));
             $buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 20);
         }
         // If edit permissions are set, see
         // \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
         if ($localCalcPerms & Permission::PAGE_EDIT && !empty($this->id) && $this->editLockPermissions()) {
             // Edit
             $params = '&edit[pages][' . $this->pageRow['uid'] . ']=edit';
             $onClick = BackendUtility::editOnClick($params, '', -1);
             $editButton = $buttonBar->makeLinkButton()->setHref('#')->setOnClick($onClick)->setTitle($lang->getLL('editPage', true))->setIcon($this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL));
             $buttonBar->addButton($editButton, ButtonBar::BUTTON_POSITION_LEFT, 20);
         }
         // Paste
         if (($localCalcPerms & Permission::PAGE_NEW || $localCalcPerms & Permission::CONTENT_EDIT) && $this->editLockPermissions()) {
             $elFromTable = $this->clipObj->elFromTable('');
             if (!empty($elFromTable)) {
                 $onClick = 'return ' . $this->clipObj->confirmMsg('pages', $this->pageRow, 'into', $elFromTable);
                 $pasteButton = $buttonBar->makeLinkButton()->setHref($this->clipObj->pasteUrl('', $this->id))->setOnClick($onClick)->setTitle($lang->getLL('clip_paste', true))->setIcon($this->iconFactory->getIcon('actions-document-paste-after', Icon::SIZE_SMALL));
                 $buttonBar->addButton($pasteButton, ButtonBar::BUTTON_POSITION_LEFT, 40);
             }
         }
         // Cache
         $clearCacheButton = $buttonBar->makeLinkButton()->setHref($this->listURL() . '&clear_cache=1')->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.clear_cache', true))->setIcon($this->iconFactory->getIcon('actions-system-cache-clear', Icon::SIZE_SMALL));
         $buttonBar->addButton($clearCacheButton, ButtonBar::BUTTON_POSITION_RIGHT);
         if ($this->table && (!isset($module->modTSconfig['properties']['noExportRecordsLinks']) || isset($module->modTSconfig['properties']['noExportRecordsLinks']) && !$module->modTSconfig['properties']['noExportRecordsLinks'])) {
             // CSV
             $csvButton = $buttonBar->makeLinkButton()->setHref($this->listURL() . '&csv=1')->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.csv', true))->setIcon($this->iconFactory->getIcon('actions-document-export-csv', Icon::SIZE_SMALL));
             $buttonBar->addButton($csvButton, ButtonBar::BUTTON_POSITION_LEFT, 40);
             // Export
             if (ExtensionManagementUtility::isLoaded('impexp')) {
                 $url = BackendUtility::getModuleUrl('xMOD_tximpexp', array('tx_impexp[action]' => 'export'));
                 $exportButton = $buttonBar->makeLinkButton()->setHref($url . '&tx_impexp[list][]=' . rawurlencode($this->table . ':' . $this->id))->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.export', true))->setIcon($this->iconFactory->getIcon('actions-document-export-t3d', Icon::SIZE_SMALL));
                 $buttonBar->addButton($exportButton, ButtonBar::BUTTON_POSITION_LEFT, 40);
             }
         }
         // Reload
         $reloadButton = $buttonBar->makeLinkButton()->setHref($this->listURL())->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.reload', true))->setIcon($this->iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL));
         $buttonBar->addButton($reloadButton, ButtonBar::BUTTON_POSITION_RIGHT);
         // Shortcut
         if ($backendUser->mayMakeShortcut()) {
             $shortCutButton = $buttonBar->makeShortcutButton()->setModuleName('web_list')->setGetVariables(['id', 'M', 'imagemode', 'pointer', 'table', 'search_field', 'search_levels', 'showLimit', 'sortField', 'sortRev'])->setSetVariables(array_keys($this->MOD_MENU));
             $buttonBar->addButton($shortCutButton, ButtonBar::BUTTON_POSITION_RIGHT);
         }
         // Back
         if ($this->returnUrl) {
             $href = htmlspecialchars(GeneralUtility::linkThisUrl($this->returnUrl, array('id' => $this->id)));
             $buttons['back'] = '<a href="' . $href . '" class="typo3-goBack" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', true) . '">' . $this->iconFactory->getIcon('actions-view-go-back', Icon::SIZE_SMALL) . '</a>';
         }
     }
 }
 /**
  * Main function, rendering the upload file form fields
  *
  * @return void
  */
 public function main()
 {
     // Make page header:
     $this->content = $this->doc->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.pagetitle'));
     $form = $this->renderUploadForm();
     $pageContent = $this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.pagetitle')) . $this->doc->section('', $form);
     // Header Buttons
     $docHeaderButtons = array('csh' => BackendUtility::cshItem('xMOD_csh_corebe', 'file_upload', $GLOBALS['BACK_PATH']), 'back' => '');
     $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $pageContent, 'PATH' => $this->title);
     // Back
     if ($this->returnUrl) {
         $docHeaderButtons['back'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
     }
     $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
     $this->content .= $this->doc->endPage();
     $this->content = $this->doc->insertStylesAndJS($this->content);
 }
示例#19
0
 /**
  * Create the panel of buttons for submitting the form
  * or otherwise perform operations.
  *
  * @param array $row Data
  *
  * @return array all available buttons as an assoc. array
  */
 public function getButtons(array $row)
 {
     $language = $this->getLanguageService();
     $buttons = array('csh' => '', 'view' => '', 'edit' => '', 'hide_unhide' => '', 'move' => '', 'new_record' => '', 'paste' => '', 'level_up' => '', 'cache' => '', 'reload' => '', 'shortcut' => '', 'back' => '', 'csv' => '', 'export' => '');
     // Get users permissions for this row:
     $localCalcPerms = $this->getBackendUser()->calcPerms($row);
     // CSH
     if (!strlen($this->id)) {
         $buttons['csh'] = BackendUtility::cshItem('xMOD_csh_commerce', 'list_module_noId', $GLOBALS['BACK_PATH'], '', TRUE);
     } elseif (!$this->id) {
         $buttons['csh'] = BackendUtility::cshItem('xMOD_csh_commerce', 'list_module_root', $GLOBALS['BACK_PATH'], '', TRUE);
     } else {
         $buttons['csh'] = BackendUtility::cshItem('xMOD_csh_commerce', 'list_module', $GLOBALS['BACK_PATH'], '', TRUE);
     }
     if (isset($this->id)) {
         // New record
         if (!$GLOBALS['SOBE']->modTSconfig['properties']['noCreateRecordsLink']) {
             $params = '&parentCategory=' . $this->parentUid;
             $buttons['new_record'] = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'' . $this->backPath . 'db_new.php?id=' . $this->id . $params . '\');') . '" title="' . $language->getLL('newRecordGeneral', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-new') . '</a>';
         }
         // If edit permissions are set, see
         // \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
         if ($localCalcPerms & 2 && !empty($this->id)) {
             // Edit
             $params = '&edit[tx_commerce_categories][' . $this->pageRow['uid'] . ']=edit';
             $buttons['edit'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, $this->backPath, -1)) . '" title="' . $language->getLL('editPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-page-open') . '</a>';
         }
         // Paste
         if (($localCalcPerms & 8 || $localCalcPerms & 16) && $this->parentUid) {
             $elFromTable = $this->clipObj->elFromTable('');
             if (count($elFromTable)) {
                 $buttons['paste'] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('', $this->id)) . '" onclick="' . htmlspecialchars('return ' . $this->clipObj->confirmMsg('tx_commerce_categories', $this->pageRow, 'into', $elFromTable)) . '" title="' . $language->getLL('clip_paste', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-paste-after') . '</a>';
             }
         }
         if ($this->table && (!isset($GLOBALS['SOBE']->modTSconfig['properties']['noExportRecordsLinks']) || isset($GLOBALS['SOBE']->modTSconfig['properties']['noExportRecordsLinks']) && !$GLOBALS['SOBE']->modTSconfig['properties']['noExportRecordsLinks'])) {
             // CSV
             $buttons['csv'] = '<a href="' . htmlspecialchars($this->listURL() . '&csv=1') . '" title="' . $language->sL('LLL:EXT:lang/locallang_core.xlf:labels.csv', TRUE) . '">' . IconUtility::getSpriteIcon('mimetypes-text-csv') . '</a>';
             // Export
             if (ExtensionManagementUtility::isLoaded('impexp')) {
                 $url = BackendUtility::getModuleUrl('xMOD_tximpexp', array('tx_impexp[action]' => 'export'));
                 $buttons['export'] = '<a href="' . htmlspecialchars($url . '&tx_impexp[list][]=' . rawurlencode($this->table . ':' . $this->id)) . '" title="' . $language->sL('LLL:EXT:lang/locallang_core.xlf:rm.export', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-export-t3d') . '</a>';
             }
         }
         // Reload
         $buttons['reload'] = '<a href="' . htmlspecialchars($this->listURL()) . '" title="' . $language->sL('LLL:EXT:lang/locallang_core.xlf:labels.reload', TRUE) . '">' . IconUtility::getSpriteIcon('actions-system-refresh') . '</a>';
         // Shortcut
         if ($this->getBackendUser()->mayMakeShortcut()) {
             $buttons['shortcut'] = $this->getDocumentTemplate()->makeShortcutIcon('id, imagemode, pointer, table, search_field, search_levels, showLimit, sortField, sortRev', implode(',', array_keys($this->MOD_MENU)), 'web_list');
         }
         // Back
         if ($this->returnUrl) {
             $buttons['back'] = '<a href="' . htmlspecialchars(GeneralUtility::linkThisUrl($this->returnUrl, array('id' => $this->id))) . '" class="typo3-goBack" title="' . $language->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
         }
         if (!empty($this->parentUid)) {
             // Setting title of page + the "Go up" link:
             $temp = $this->parentUid;
             $this->parentUid = $this->pageRow['pid'];
             $buttons['level_up'] = '<a href="' . htmlspecialchars($this->listURL($this->id)) . '" onclick="setHighlight(' . $this->pageRow['pid'] . ')" title="' . $language->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel', TRUE) . '">' . IconUtility::getSpriteIcon('actions-view-go-up') . '</a>';
             $this->parentUid = $temp;
         }
     }
     return $buttons;
 }
    /**
     * 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' => '');
        // Back
        if ($this->returnUrl) {
            $docHeaderButtons['back'] = '<a href="' . htmlspecialchars(GeneralUtility::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
        }
        // Add the HTML as a section:
        $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => '', 'CONTENT' => $pageContent, 'PATH' => $this->title);
        $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
        $this->content .= $this->doc->endPage();
        $this->content = $this->doc->insertStylesAndJS($this->content);
    }
    /**
     * Main function, rendering the content of the rename form
     *
     * @return void
     */
    public function main()
    {
        $lang = $this->getLanguageService();
        $code = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_file')) . '" role="form" method="post" name="editform" enctype="multipart/form-data">';
        // Making the formfields for renaming:
        $code .= '
			<div class="form-group">
				<input type="checkbox" value="1" id="keepFilename" name="file[replace][1][keepFilename]"> <label for="keepFilename">' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_replace.php.keepfiletitle') . '</label>
			</div>

			<div class="form-group">
				<label for="file_replace">' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_replace.php.selectfile') . '</label>
				<div class="input-group col-xs-6">
					<input type="text" name="fakefile" id="fakefile" class="form-control input-xlarge" readonly>
					<a class="input-group-addon btn btn-primary" onclick="TYPO3.jQuery(\'#file_replace\').click();">' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_replace.php.browse') . '</a>
				</div>
				<input class="form-control" type="file" id="file_replace" name="replace_1" style="visibility: hidden;" />
			</div>

			<script>
			TYPO3.jQuery(\'#file_replace\').change(function(){
				TYPO3.jQuery(\'#fakefile\').val(TYPO3.jQuery(this).val());
			});
			</script>

			<input type="hidden" name="overwriteExistingFiles" value="replace" />
			<input type="hidden" name="file[replace][1][data]" value="1" />
			<input type="hidden" name="file[replace][1][uid]" value="' . $this->uid . '" />
		';
        // Making submit button:
        $code .= '
				<div class="form-group">
					<input class="btn btn-primary" type="submit" value="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_replace.php.submit', true) . '" />
					<input class="btn btn-danger" type="submit" value="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.cancel', true) . '" onclick="backToList(); return false;" />
					<input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" />
				</div>
		';
        $code .= '</form>';
        $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
        // csh button
        $cshButton = $buttonBar->makeHelpButton()->setModuleName('xMOD_csh_corebe')->setFieldName('file_rename');
        $buttonBar->addButton($cshButton);
        // Back button
        if ($this->returnUrl) {
            $returnButton = $buttonBar->makeLinkButton()->setHref(GeneralUtility::linkThisUrl($this->returnUrl))->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL));
            $buttonBar->addButton($returnButton);
        }
        $this->content .= '<h1>' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_replace.php.pagetitle') . '</h1>';
        // Add the HTML as a section:
        $this->content .= '<div>' . $code . '</div>';
        $this->moduleTemplate->setContent($this->content);
    }
 /**
  * [Describe function...]
  *
  * @param	[type]		$url: ...
  * @param	[type]		$val: ...
  * @param	[type]		$uid: ...
  * @return	[type]		...
  */
 function linkSingleView($url, $val, $uid)
 {
     $params = array('id' => $this->singlePid, 'tx_ttnews[tt_news]' => $uid, 'no_cache' => 1);
     $linkedurl = \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($url, $params);
     $onclick = 'openFePreview(\'' . htmlspecialchars($linkedurl) . '\');';
     $lTitle = $GLOBALS['LANG']->getLL('openFePreview', 1);
     $link = '<a href="#" onclick="' . $onclick . '" title="' . $lTitle . '">' . $val . '</a>';
     return $link;
 }