Exemplo n.º 1
0
 /**
  * Show general information and the installed modules
  *
  * @return void
  */
 public function indexAction()
 {
     $warnings = array();
     $contentWarnings = '';
     // Hook for additional warnings
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'] as $classRef) {
             $hookObj = GeneralUtility::getUserObj($classRef);
             if (method_exists($hookObj, 'displayWarningMessages_postProcess')) {
                 $hookObj->displayWarningMessages_postProcess($warnings);
             }
         }
     }
     if (!empty($warnings)) {
         if (count($warnings) > 1) {
             $securityWarnings = '<ul><li>' . implode('</li><li>', $warnings) . '</li></ul>';
         } else {
             $securityWarnings = '<p>' . implode('', $warnings) . '</p>';
         }
         $securityMessage = GeneralUtility::makeInstance(FlashMessage::class, $securityWarnings, $this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:warning.header'), FlashMessage::ERROR);
         $contentWarnings = '<div style="margin: 20px 0;">' . $securityMessage->render() . '</div>';
         unset($warnings);
     }
     $this->view->assignMultiple(array('TYPO3Version' => TYPO3_version, 'copyRightNotice' => BackendUtility::TYPO3_copyRightNotice(), 'warningMessages' => $contentWarnings, 'modules' => $this->getModulesData()));
 }
Exemplo n.º 2
0
 /**
  * Create the panel of buttons for submitting the form or otherwise perform operations.
  */
 protected function getButtons()
 {
     $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
     // View page
     $viewButton = $buttonBar->makeLinkButton()->setHref('#')->setOnClick(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid'])))->setTitle($this->languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.showPage'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-view', Icon::SIZE_SMALL));
     $buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 1);
     // Shortcut
     $shortCutButton = $buttonBar->makeShortcutButton()->setModuleName($this->moduleName)->setDisplayName($this->MOD_MENU['function'][$this->MOD_SETTINGS['function']])->setGetVariables(['M', 'id', 'edit_record', 'pointer', 'new_unique_uid', 'search_field', 'search_levels', 'showLimit'])->setSetVariables(array_keys($this->MOD_MENU));
     $buttonBar->addButton($shortCutButton, ButtonBar::BUTTON_POSITION_RIGHT);
 }
 /**
  * Return label
  *        if LLL parse
  *        if empty take value
  *
  * @param null|string $label
  * @param string $fallback
  * @return string
  */
 protected function getLabel($label, $fallback)
 {
     if (strpos($label, 'LLL:') === 0) {
         $label = $this->languageService->sL($label);
     }
     if (empty($label)) {
         $label = $fallback;
     }
     return $label;
 }
 /**
  * Adding CM element for Delete
  *
  * @param	string	$table	Table name
  * @param	integer	$uid	UID for the current record.
  * @param	array	$elInfo	Label for including in the confirmation message, EXT:lang/locallang_core.php:mess.delete
  * @return	array		Item array, element in $menuItems
  * @internal
  */
 function DB_delete($table, $uid, $elInfo)
 {
     $loc = 'top.content.list_frame';
     if ($this->beUser->jsConfirmation(4)) {
         $conf = "confirm(" . GeneralUtility::quoteJSvalue(sprintf($this->LANG->sL('LLL:EXT:lang/locallang_core.php:mess.delete'), $elInfo[0]) . BackendUtility::referenceCount($table, $uid, ' (There are %s reference(s) to this record!)')) . ")";
     } else {
         $conf = '1==1';
     }
     $editOnClick = 'if(' . $loc . " && " . $conf . " ){" . $loc . ".location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(" . $this->backRef->frameLocation($loc . '.document') . ")+'" . "&cmd[" . $table . '][' . $uid . '][DDdelete]=1&prErr=1&vC=' . $this->beUser->veriCode() . BackendUtility::getUrlToken('tceAction') . "';hideCM();}";
     return $this->backRef->linkItem($this->LANG->getLLL('delete', $this->LL), $this->backRef->excludeIcon(IconUtility::getSpriteIcon('actions-edit-delete')), $editOnClick . 'return false;');
 }
Exemplo n.º 5
0
 /**
  * Create the panel of buttons for submitting the form or otherwise perform operations.
  *
  * @return array All available buttons as an assoc. array
  */
 protected function getButtons()
 {
     $buttons = array('csh' => '', 'view' => '', 'shortcut' => '');
     // CSH
     $buttons['csh'] = BackendUtility::cshItem('_MOD_web_info', '');
     // View page
     $buttons['view'] = '<a href="#" ' . 'onclick="' . htmlspecialchars(BackendUtility::viewOnClick($this->pageinfo['uid'], $GLOBALS['BACK_PATH'], BackendUtility::BEgetRootLine($this->pageinfo['uid']))) . '" ' . 'title="' . $this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
     // Shortcut
     if ($this->backendUser->mayMakeShortcut()) {
         $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->moduleName);
     }
     return $buttons;
 }
Exemplo n.º 6
0
 /**
  * Create configuration form
  *
  * @param array $inData Form configuration data
  * @return void
  */
 public function makeConfigurationForm($inData)
 {
     $nameSuggestion = '';
     // Page tree export options:
     if (isset($inData['pagetree']['id'])) {
         $this->standaloneView->assign('treeHTML', $this->treeHTML);
         $opt = array('-2' => $this->lang->getLL('makeconfig_tablesOnThisPage'), '-1' => $this->lang->getLL('makeconfig_expandedTree'), '0' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_0'), '1' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_1'), '2' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_2'), '3' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_3'), '4' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_4'), '999' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_infi'));
         $this->standaloneView->assign('levelSelectOptions', $opt);
         $this->standaloneView->assign('tableSelectOptions', $this->getTableSelectOptions('pages'));
         $nameSuggestion .= 'tree_PID' . $inData['pagetree']['id'] . '_L' . $inData['pagetree']['levels'];
     }
     // Single record export:
     if (is_array($inData['record'])) {
         $records = array();
         foreach ($inData['record'] as $ref) {
             $rParts = explode(':', $ref);
             $tName = $rParts[0];
             $rUid = $rParts[1];
             $nameSuggestion .= $tName . '_' . $rUid;
             $rec = BackendUtility::getRecordWSOL($tName, $rUid);
             if (!empty($rec)) {
                 $records[] = array('icon' => $this->iconFactory->getIconForRecord($tName, $rec, Icon::SIZE_SMALL)->render(), 'title' => BackendUtility::getRecordTitle($tName, $rec, true), 'tableName' => $tName, 'recordUid' => $rUid);
             }
         }
         $this->standaloneView->assign('records', $records);
     }
     // Single tables/pids:
     if (is_array($inData['list'])) {
         // Display information about pages from which the export takes place
         $tableList = array();
         foreach ($inData['list'] as $reference) {
             $referenceParts = explode(':', $reference);
             $tableName = $referenceParts[0];
             if ($this->getBackendUser()->check('tables_select', $tableName)) {
                 // If the page is actually the root, handle it differently
                 // NOTE: we don't compare integers, because the number actually comes from the split string above
                 if ($referenceParts[1] === '0') {
                     $iconAndTitle = $this->iconFactory->getIcon('apps-pagetree-root', Icon::SIZE_SMALL)->render() . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
                 } else {
                     $record = BackendUtility::getRecordWSOL('pages', $referenceParts[1]);
                     $iconAndTitle = $this->iconFactory->getIconForRecord('pages', $record, Icon::SIZE_SMALL)->render() . BackendUtility::getRecordTitle('pages', $record, true);
                 }
                 $tableList[] = array('tableName' => $tableName, 'iconAndTitle' => $iconAndTitle, 'reference' => $reference);
             }
         }
         $this->standaloneView->assign('tableList', $tableList);
     }
     $this->standaloneView->assign('externalReferenceTableSelectOptions', $this->getTableSelectOptions());
     $this->standaloneView->assign('externalStaticTableSelectOptions', $this->getTableSelectOptions());
     $this->standaloneView->assign('nameSuggestion', $nameSuggestion);
 }
 /**
  * Initializes the controller before invoking an action method.
  *
  * @return void
  */
 protected function initializeAction()
 {
     $this->pageId = (int) GeneralUtility::_GP('id');
     $this->pageRenderer->addInlineLanguageLabelArray(array('title' => $this->languageService->getLL('title'), 'path' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.path'), 'table' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.table'), 'depth' => $this->languageService->sL('LLL:EXT:lang/locallang_mod_web_perm.xml:Depth'), 'depth_0' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_0'), 'depth_1' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_1'), 'depth_2' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_2'), 'depth_3' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_3'), 'depth_4' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_4'), 'depth_infi' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_infi')));
     $this->pageRenderer->addInlineLanguageLabelFile('EXT:typo3_forum/Resources/Private/Language/locallang_mod.xml');
     $this->pageRenderer->loadExtJS();
     $this->pageRenderer->enableExtJSQuickTips();
     $this->pageRenderer->addJsFile(ExtensionManagementUtility::extRelPath('lang') . 'res/js/be/typo3lang.js');
     $this->pageRenderer->addJsFile($this->backPath . 'js/extjs/ux/Ext.ux.FitToParent.js');
     $this->includeJavascriptFromPath('Resources/Public/Javascript/Backend/ExtJS/');
     $this->includeJavascriptFromPath('Resources/Public/Javascript/Backend/ForumIndex/');
     $this->includeCssFromPath('Resources/Public/Javascript/Backend/ExtJS/');
     $this->pageRenderer->addCssFile(ExtensionManagementUtility::extRelPath('typo3_forum') . 'Resources/Public/Stylesheets/typo3_forum-backend.css');
 }
Exemplo n.º 8
0
 /**
  * Returns the item array for form field selection.
  *
  * @param int $colPos
  * @param array $excludeLayouts
  * @param array $allowedGridTypes
  *
  * @return array
  */
 public function getLayoutWizardItems($colPos, $excludeLayouts = array(), $allowedGridTypes = array())
 {
     $wizardItems = array();
     $excludeLayouts = array_flip(explode(',', $excludeLayouts));
     foreach ($this->layoutSetup as $layoutId => $item) {
         if (!empty($allowedGridTypes) && !isset($allowedGridTypes[$layoutId])) {
             continue;
         }
         if ((int) $colPos === -1 && $item['top_level_layout'] || isset($excludeLayouts[$item['uid']])) {
             continue;
         }
         $wizardItems[] = array('uid' => $layoutId, 'title' => $this->languageService->sL($item['title']), 'description' => $this->languageService->sL($item['description']), 'icon' => $item['icon'], 'iconIdentifier' => $item['iconIdentifier'], 'tll' => $item['top_level_layout']);
     }
     return $wizardItems;
 }
 /**
  * Show Note if no Email or Name selected
  *
  * @param array $params Config Array
  * @return string
  */
 public function showNote($params)
 {
     $this->initialize();
     $content = '';
     if (!$this->showNoteActive($params)) {
         return $content;
     }
     if (!$this->senderEmailOrSenderNameSet($params['row']['uid'])) {
         if ($this->noteFieldDisabled($params)) {
             $content .= '<p style="opacity: 0.3; margin: 0;">';
             $content .= $this->getCheckboxHtml($params);
             $content .= '<label for="tx_powermail_domain_model_forms_note_checkbox"' . ' style="vertical-align: bottom;">';
             $content .= $this->languageService->sL($this->locallangPath . 'tx_powermail_domain_model_forms.note.4', true);
             $content .= '</label>';
             $content .= '<p style="margin: 0 0 3px 0;">';
         } else {
             $content .= '<div style="background-color: #FCF8E3; border: 1px solid #FFB019;' . ' padding: 5px 10px; color: #FFB019;">';
             $content .= '<p style="margin: 0 0 3px 0;">';
             $content .= '<strong>';
             $content .= $this->languageService->sL($this->locallangPath . 'tx_powermail_domain_model_forms.note.1', true);
             $content .= '</strong>';
             $content .= ' ';
             $content .= $this->languageService->sL($this->locallangPath . 'tx_powermail_domain_model_forms.note.2', true);
             $content .= '</p>';
             $content .= '<p style="margin: 0;">';
             $content .= $this->getCheckboxHtml($params);
             $content .= '<label for="tx_powermail_domain_model_forms_note_checkbox"' . ' style="vertical-align: bottom;">';
             $content .= $this->languageService->sL($this->locallangPath . 'tx_powermail_domain_model_forms.note.3', true);
             $content .= '</label>';
             $content .= '</p>';
             $content .= '</div>';
         }
     }
     if (!$this->hasFormUniqueFieldMarkers($params['row']['uid'])) {
         $content .= '<div style="background:#F2DEDE; border:1px solid #A94442;' . ' padding: 5px 10px; color: #A94442; margin-top: 10px">';
         $content .= '<p><strong>';
         $content .= $this->languageService->sL($this->locallangPath . 'tx_powermail_domain_model_forms.error.1', true);
         $content .= '</strong></p>';
         $content .= '<p>';
         $content .= $this->languageService->sL($this->locallangPath . 'tx_powermail_domain_model_forms.error.2', true);
         $content .= '</p>';
         $content .= '</div>';
     }
     return $content;
 }
Exemplo n.º 10
0
 /**
  * return content collapse icon
  *
  * @param array $data
  * @param string $sortField
  * @param int $level
  * @param string $contentCollapseIcon
  * @param DatabaseRecordList $parentObj
  */
 public function contentCollapseIcon(&$data, $sortField, $level, &$contentCollapseIcon, $parentObj)
 {
     if ($data['_EXPAND_TABLE_'] === 'tt_content') {
         $expandTitle = $this->languageService->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xlf:list.expandElement');
         $collapseTitle = $this->languageService->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xlf:list.collapseElement');
         $expandedGridelements = $parentObj->getExpandedGridelements();
         if ($expandedGridelements[$data['uid']]) {
             $href = htmlspecialchars($parentObj->listURL() . '&gridelementsExpand[' . (int) $data['uid'] . ']=0');
             $contentCollapseIcon = '<a
             class="btn btn-default t3js-toggle-gridelements-list open-gridelements-container" data-state="expanded" href="' . $href . '" id="t3-gridelements-' . $data['uid'] . '"
             title="' . $collapseTitle . '"
             data-toggle-title="' . $expandTitle . '">' . $this->getIconFactory()->getIcon('actions-view-list-expand', 'small')->render() . $this->getIconFactory()->getIcon('actions-view-list-collapse', 'small')->render() . '</a>';
         } else {
             $href = htmlspecialchars($parentObj->listURL() . '&gridelementsExpand[' . (int) $data['uid'] . ']=1');
             $contentCollapseIcon = '<a
             class="btn btn-default t3js-toggle-gridelements-list" data-state="collapsed" href="' . $href . '" id="t3-gridelements-' . $data['uid'] . '"
             title="' . $expandTitle . '"
             data-toggle-title="' . $collapseTitle . '">' . $this->getIconFactory()->getIcon('actions-view-list-expand', 'small')->render() . $this->getIconFactory()->getIcon('actions-view-list-collapse', 'small')->render() . '</a>';
         }
     }
 }
Exemplo n.º 11
0
 /**
  * Show general information and the installed modules
  *
  * @return void
  */
 public function indexAction()
 {
     $warnings = [];
     $securityWarnings = '';
     // Hook for additional warnings
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages'] as $classRef) {
             $hookObj = GeneralUtility::getUserObj($classRef);
             if (method_exists($hookObj, 'displayWarningMessages_postProcess')) {
                 $hookObj->displayWarningMessages_postProcess($warnings);
             }
         }
     }
     if (!empty($warnings)) {
         if (count($warnings) > 1) {
             $securityWarnings = '<ul><li>' . implode('</li><li>', $warnings) . '</li></ul>';
         } else {
             $securityWarnings = '<p>' . implode('', $warnings) . '</p>';
         }
         unset($warnings);
     }
     $this->view->assignMultiple(['TYPO3Version' => TYPO3_version, 'copyRightNotice' => BackendUtility::TYPO3_copyRightNotice(), 'warningMessages' => $securityWarnings, 'warningTitle' => $this->languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:warning.header'), 'modules' => $this->getModulesData()]);
 }
Exemplo n.º 12
0
 /**
  * Retursn the panel of buttons for submitting the form or otherwise perform operations.
  *
  * @return array Returns all available buttons as an associative array (TYPO3 <= 7.5).
  */
 protected function getButtons()
 {
     $buttons = array('csh' => '', 'shortcut' => '', 'close' => '', 'save' => '', 'save_close' => '');
     // CSH
     $buttons['csh'] = BackendUtility::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH']);
     // CLOSE button
     if (version_compare(TYPO3_version, '6.99.99', '<=')) {
         $closeLink = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-close', array('html' => '<input type="image" name="_close" class="c-inputButton" src="clear.gif" title="' . $this->languageService->sL('LLL:EXT:image_autoresize/Resources/Private/Language/locallang.xlf:closeConfiguration', true) . '" />'));
     } else {
         $closeUrl = BackendUtility::getModuleUrl('tools_ExtensionmanagerExtensionmanager');
         $closeLink = '<a href="#" onclick="document.location=\'' . htmlspecialchars($closeUrl) . '\'" title="' . $this->languageService->sL('LLL:EXT:image_autoresize/Resources/Private/Language/locallang.xlf:closeConfiguration', true) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-close') . '</a>';
     }
     $buttons['close'] = $closeLink;
     // SAVE button
     $buttons['save'] = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-save', array('html' => '<input type="image" name="_savedok" class="c-inputButton" src="clear.gif" title="' . $this->languageService->sL('LLL:EXT:image_autoresize/Resources/Private/Language/locallang.xlf:saveConfiguration', true) . '" />'));
     // SAVE_CLOSE button
     $buttons['save_close'] = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-save-close', array('html' => '<input type="image" name="_saveandclosedok" class="c-inputButton" src="clear.gif" title="' . $this->languageService->sL('LLL:EXT:image_autoresize/Resources/Private/Language/locallang.xlf:saveCloseConfiguration', true) . '" />'));
     // Shortcut
     if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
         $buttons['shortcut'] = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']);
     }
     return $buttons;
 }
Exemplo n.º 13
0
 /**
  * CSV row titles
  *
  * @param array $row
  * @param array $conf
  * @param mixed $table Not used
  * @return string
  */
 public function csvRowTitles($row, $conf, $table)
 {
     $out = '';
     $SET = $GLOBALS['SOBE']->MOD_SETTINGS;
     foreach ($row as $fieldName => $fieldValue) {
         if (GeneralUtility::inList($SET['queryFields'], $fieldName) || !$SET['queryFields'] && $fieldName != 'pid') {
             if (!$out) {
                 if ($GLOBALS['SOBE']->MOD_SETTINGS['search_result_labels']) {
                     $out = htmlspecialchars($this->languageService->sL($conf['columns'][$fieldName]['label'] ? $conf['columns'][$fieldName]['label'] : $fieldName));
                 } else {
                     $out = htmlspecialchars($this->languageService->sL($fieldName));
                 }
             } else {
                 if ($GLOBALS['SOBE']->MOD_SETTINGS['search_result_labels']) {
                     $out .= ',' . htmlspecialchars($this->languageService->sL($conf['columns'][$fieldName]['label'] ? $conf['columns'][$fieldName]['label'] : $fieldName));
                 } else {
                     $out .= ',' . htmlspecialchars($this->languageService->sL($fieldName));
                 }
             }
         }
     }
     return $out;
 }
 /**
  * Get localized label from locallang_db.xlf
  *
  * @param string $key
  * @return string
  */
 protected function getLocalizedLabel($key)
 {
     return $this->languageService->sL($this->locallangPath . $key);
 }
 /**
  * Returns the translation for the given key.
  *
  * @param string $key
  * @return string
  */
 protected function translate($key)
 {
     return $this->languageService->sL('LLL:' . $this->languageFile . ':' . $key);
 }
    /**
     * Import part of module
     *
     * @param array $inData Content of POST VAR tx_impexp[]..
     * @throws \BadFunctionCallException
     * @throws \InvalidArgumentException
     * @throws \RuntimeException
     * @return void Setting content in $this->content
     */
    public function importData($inData)
    {
        $access = is_array($this->pageinfo) ? 1 : 0;
        $beUser = $this->getBackendUser();
        if ($this->id && $access || $beUser->user['admin'] && !$this->id) {
            if ($beUser->user['admin'] && !$this->id) {
                $this->pageinfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0);
            }
            if ($inData['new_import']) {
                unset($inData['import_mode']);
            }
            /** @var $import \TYPO3\CMS\Impexp\ImportExport */
            $import = GeneralUtility::makeInstance(\TYPO3\CMS\Impexp\ImportExport::class);
            $import->init(0, 'import');
            $import->update = $inData['do_update'];
            $import->import_mode = $inData['import_mode'];
            $import->enableLogging = $inData['enableLogging'];
            $import->global_ignore_pid = $inData['global_ignore_pid'];
            $import->force_all_UIDS = $inData['force_all_UIDS'];
            $import->showDiff = !$inData['notShowDiff'];
            $import->allowPHPScripts = $inData['allowPHPScripts'];
            $import->softrefInputValues = $inData['softrefInputValues'];
            // OUTPUT creation:
            $menuItems = array();
            // Make input selector:
            // must have trailing slash.
            $path = $this->getDefaultImportExportFolder();
            $exportFiles = $this->getExportFiles();
            $this->shortcutName .= ' (' . $this->pageinfo['title'] . ')';
            // Configuration
            $row = array();
            $selectOptions = array('');
            foreach ($exportFiles as $file) {
                $selectOptions[$file->getCombinedIdentifier()] = $file->getPublicUrl();
            }
            $row[] = '
				<tr>
					<th colspan="2">' . $this->lang->getLL('importdata_selectFileToImport', true) . '</th>
				</tr>';
            $noCompressorAvailable = !$import->compress ? '<br /><span class="text-danger">' . $this->lang->getLL('importdata_noteNoDecompressorAvailable', true) . '</span>' : '';
            $row[] = '
				<tr>
					<td valign="top">
						' . $this->lang->getLL('importdata_file', true) . '' . BackendUtility::cshItem('xMOD_tx_impexp', 'importFile') . '
					</td>
					<td>
						' . $this->renderSelectBox('tx_impexp[file]', $inData['file'], $selectOptions) . '<br />' . sprintf($this->lang->getLL('importdata_fromPathS', true), $path ? $path->getCombinedIdentifier() : $this->lang->getLL('importdata_no_accessible_file_mount', true)) . $noCompressorAvailable . '
					</td>
				</tr>';
            $row[] = '
				<tr>
					<th colspan="2">
						' . $this->lang->getLL('importdata_importOptions', true) . '
					</th>
				</tr>';
            $row[] = '
				<tr>
					<td valign="top">
						' . $this->lang->getLL('importdata_update', true) . BackendUtility::cshItem('xMOD_tx_impexp', 'update') . '
					</td>
					<td>
						<input type="checkbox" name="tx_impexp[do_update]" id="checkDo_update" value="1"' . ($inData['do_update'] ? ' checked="checked"' : '') . ' />
						<label for="checkDo_update">' . $this->lang->getLL('importdata_updateRecords', true) . '</label>
						<br/>
						<em>(' . $this->lang->getLL('importdata_thisOptionRequiresThat', true) . ')</em>' . ($inData['do_update'] ? '	<hr/>
						<input type="checkbox" name="tx_impexp[global_ignore_pid]" id="checkGlobal_ignore_pid" value="1"' . ($inData['global_ignore_pid'] ? ' checked="checked"' : '') . ' />
						<label for="checkGlobal_ignore_pid">' . $this->lang->getLL('importdata_ignorePidDifferencesGlobally', true) . '</label><br/>
						<em>(' . $this->lang->getLL('importdata_ifYouSetThis', true) . ')</em>
						' : '') . '
					</td>
				</tr>';
            $allowPhpScripts = $beUser->isAdmin() ? '
					<input type="checkbox" name="tx_impexp[allowPHPScripts]" id="checkAllowPHPScripts" value="1"' . ($inData['allowPHPScripts'] ? ' checked="checked"' : '') . ' />
					<label for="checkAllowPHPScripts">' . $this->lang->getLL('importdata_allowToWriteBanned', true) . '</label><br/>' : '';
            $doUpdate = !$inData['do_update'] && $beUser->isAdmin() ? '
					<br/>
					<input type="checkbox" name="tx_impexp[force_all_UIDS]" id="checkForce_all_UIDS" value="1"' . ($inData['force_all_UIDS'] ? ' checked="checked"' : '') . ' />
					<label for="checkForce_all_UIDS"><span class="text-danger">' . $this->lang->getLL('importdata_force_all_UIDS', true) . '</span></label><br/>
					<em>(' . $this->lang->getLL('importdata_force_all_UIDS_descr', true) . ')</em>' : '';
            $row[] = '<tr>
					<td valign="top">
						' . $this->lang->getLL('importdata_options', true) . BackendUtility::cshItem('xMOD_tx_impexp', 'options') . '
					</td>
					<td>
						<input type="checkbox" name="tx_impexp[notShowDiff]" id="checkNotShowDiff" value="1"' . ($inData['notShowDiff'] ? ' checked="checked"' : '') . ' />
						<label for="checkNotShowDiff">' . $this->lang->getLL('importdata_doNotShowDifferences', true) . '</label><br/>
						<em>(' . $this->lang->getLL('importdata_greenValuesAreFrom', true) . ')</em>
						<br/><br/>

						' . $allowPhpScripts . $doUpdate . '
					</td>
				</tr>';
            $newImport = !$inData['import_file'] ? '<input class="btn btn-default" type="submit" value="' . $this->lang->getLL('importdata_preview', true) . '" />' . ($inData['file'] ? ' - <input type="hidden" name="not-set" value="1" id="t3js-submit-field" /><input class="btn btn-default t3js-confirm-trigger" type="button" value="' . ($inData['do_update'] ? $this->lang->getLL('importdata_update_299e', true) : $this->lang->getLL('importdata_import', true)) . '" name="tx_impexp[import_file]" data-title="' . $this->lang->getLL('pleaseConfirm', true) . '" data-message="' . $this->lang->getLL('importdata_areYouSure', true) . '" />' : '') : '<input class="btn btn-default" type="submit" name="tx_impexp[new_import]" value="' . $this->lang->getLL('importdata_newImport', true) . '" />';
            $row[] = '<tr>
					<td valign="top">
						' . $this->lang->getLL('importdata_action', true) . BackendUtility::cshItem('xMOD_tx_impexp', 'action') . '
					</td>
					<td>
						' . $newImport . '
						<input type="hidden" name="tx_impexp[action]" value="import" />
					</td>
				</tr>';
            $row[] = '<tr>
				<td valign="top">
					' . $this->lang->getLL('importdata_enableLogging', true) . BackendUtility::cshItem('xMOD_tx_impexp', 'enableLogging') . '
				</td>
				<td>
					<input type="checkbox" name="tx_impexp[enableLogging]" id="checkEnableLogging" value="1"' . ($inData['enableLogging'] ? ' checked="checked"' : '') . ' />
					<label for="checkEnableLogging">' . $this->lang->getLL('importdata_writeIndividualDbActions', true) . '</label><br/>
					<em>(' . $this->lang->getLL('importdata_thisIsDisabledBy', true) . ')</em>
				</td>
				</tr>';
            $menuItems[] = array('label' => $this->lang->getLL('importdata_import', true), 'content' => '
					<table border="0" cellpadding="1" cellspacing="1">
						' . implode('
						', $row) . '
					</table>
				');
            // Upload file:
            $tempFolder = $this->getDefaultImportExportFolder();
            if ($tempFolder) {
                $row = array();
                $row[] = '
					<tr>
						<th colspan="2">' . $this->lang->getLL('importdata_uploadFileFromLocal', true) . '</th>
					</tr>';
                $row[] = '
					<tr>
						<td valign="top">
							' . $this->lang->getLL('importdata_browse', true) . BackendUtility::cshItem('xMOD_tx_impexp', 'upload') . '
						</td>
						<td>
							<input type="file" name="upload_1" size="40" />
							<input type="hidden" name="file[upload][1][target]" value="' . htmlspecialchars($tempFolder->getCombinedIdentifier()) . '" />
							<input type="hidden" name="file[upload][1][data]" value="1" />
							<br />
							<input class="btn btn-default" type="submit" name="_upload" value="' . $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.submit', true) . '" />
							<input type="checkbox" name="overwriteExistingFiles" id="checkOverwriteExistingFiles" value="1" checked="checked" />
							<label for="checkOverwriteExistingFiles">' . $this->lang->sL('LLL:EXT:lang/locallang_misc.xlf:overwriteExistingFiles', true) . '</label>
						</td>
					</tr>';
                if (GeneralUtility::_POST('_upload')) {
                    $noFileUploaded = $this->fileProcessor->internalUploadMap[1] ? $this->lang->getLL('importdata_success', true) . ' ' . $this->uploadedFiles[0]->getName() : '<span class="text-danger">' . $this->lang->getLL('importdata_failureNoFileUploaded', true) . '</span>';
                    $row[] = '<tr class="bgColor4">
							<td>' . $this->lang->getLL('importdata_uploadStatus', true) . '</td>
							<td>' . $noFileUploaded . '</td>
						</tr>';
                }
                $menuItems[] = array('label' => $this->lang->getLL('importdata_upload'), 'content' => '
						<table border="0" cellpadding="1" cellspacing="1">
							' . implode('
							', $row) . '
						</table>
					');
            }
            // Perform import or preview depending:
            $overviewContent = '';
            $extensionInstallationMessage = '';
            $inFile = $this->getFile($inData['file']);
            if ($inFile !== null && $inFile->exists()) {
                $trow = array();
                if ($import->loadFile($inFile->getForLocalProcessing(false), 1)) {
                    // Check extension dependencies:
                    $extKeysToInstall = array();
                    if (is_array($import->dat['header']['extensionDependencies'])) {
                        foreach ($import->dat['header']['extensionDependencies'] as $extKey) {
                            if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey)) {
                                $extKeysToInstall[] = $extKey;
                            }
                        }
                    }
                    if (!empty($extKeysToInstall)) {
                        $extensionInstallationMessage = 'Before you can install this T3D file you need to install the extensions "' . implode('", "', $extKeysToInstall) . '".';
                    }
                    if ($inData['import_file']) {
                        if (empty($extKeysToInstall)) {
                            $import->importData($this->id);
                            BackendUtility::setUpdateSignal('updatePageTree');
                        }
                    }
                    $import->display_import_pid_record = $this->pageinfo;
                    $overviewContent = $import->displayContentOverview();
                }
                // Meta data output:
                $trow[] = '<tr class="bgColor5">
						<td colspan="2"><strong>' . $this->lang->getLL('importdata_metaData', true) . '</strong></td>
					</tr>';
                $trow[] = '<tr class="bgColor4">
					<td><strong>' . $this->lang->getLL('importdata_title', true) . '</strong></td>
					<td width="95%">' . nl2br(htmlspecialchars($import->dat['header']['meta']['title'])) . '</td>
					</tr>';
                $trow[] = '<tr class="bgColor4">
					<td><strong>' . $this->lang->getLL('importdata_description', true) . '</strong></td>
					<td width="95%">' . nl2br(htmlspecialchars($import->dat['header']['meta']['description'])) . '</td>
					</tr>';
                $trow[] = '<tr class="bgColor4">
					<td><strong>' . $this->lang->getLL('importdata_notes', true) . '</strong></td>
					<td width="95%">' . nl2br(htmlspecialchars($import->dat['header']['meta']['notes'])) . '</td>
					</tr>';
                $trow[] = '<tr class="bgColor4">
					<td><strong>' . $this->lang->getLL('importdata_packager', true) . '</strong></td>
					<td width="95%">' . nl2br(htmlspecialchars($import->dat['header']['meta']['packager_name'] . ' (' . $import->dat['header']['meta']['packager_username'] . ')')) . '<br/>
						' . $this->lang->getLL('importdata_email', true) . ' ' . $import->dat['header']['meta']['packager_email'] . '</td>
					</tr>';
                // Thumbnail icon:
                if (is_array($import->dat['header']['thumbnail'])) {
                    $pI = pathinfo($import->dat['header']['thumbnail']['filename']);
                    if (GeneralUtility::inList('gif,jpg,png,jpeg', strtolower($pI['extension']))) {
                        // Construct filename and write it:
                        $fileName = PATH_site . 'typo3temp/importthumb.' . $pI['extension'];
                        GeneralUtility::writeFile($fileName, $import->dat['header']['thumbnail']['content']);
                        // Check that the image really is an image and not a malicious PHP script...
                        if (getimagesize($fileName)) {
                            // Create icon tag:
                            $iconTag = '<img src="../' . PathUtility::stripPathSitePrefix($fileName) . '" ' . $import->dat['header']['thumbnail']['imgInfo'][3] . ' vspace="5" style="border: solid black 1px;" alt="" />';
                            $trow[] = '<tr class="bgColor4">
								<td><strong>' . $this->lang->getLL('importdata_icon', true) . '</strong></td>
								<td>' . $iconTag . '</td>
								</tr>';
                        } else {
                            GeneralUtility::unlink_tempfile($fileName);
                        }
                    }
                }
                $menuItems[] = array('label' => $this->lang->getLL('importdata_metaData_1387'), 'content' => '
						<table border="0" cellpadding="1" cellspacing="1">
							' . implode('
							', $trow) . '
						</table>
					');
            }
            // Print errors that might be:
            $errors = $import->printErrorLog();
            $menuItems[] = array('label' => $this->lang->getLL('importdata_messages'), 'content' => $errors, 'stateIcon' => $errors ? 2 : 0);
            // Output tabs:
            $content = $this->moduleTemplate->getDynamicTabMenu($menuItems, 'tx_impexp_import', 1, false, true, false);
            if ($extensionInstallationMessage) {
                $content = '<div style="border: 1px black solid; margin: 10px 10px 10px 10px; padding: 10px 10px 10px 10px;">' . $this->moduleTemplate->icons(1) . htmlspecialchars($extensionInstallationMessage) . '</div>' . $content;
            }
            $this->content .= $this->moduleTemplate->section('', $content, 0, 1);
            // Print overview:
            if ($overviewContent) {
                $this->content .= $this->moduleTemplate->section($inData['import_file'] ? $this->lang->getLL('importdata_structureHasBeenImported', true) : $this->lang->getLL('filterpage_structureToBeImported', true), $overviewContent, 0, 1);
            }
        }
    }
Exemplo n.º 17
0
    /**
     * Renders the grid layout table after the HTML content for the single elements has been rendered
     *
     * @param array $layoutSetup : The setup of the layout that is selected for the grid we are going to render
     * @param array $row : The current data row for the container item
     * @param array $head : The data for the column headers of the grid we are going to render
     * @param array $gridContent : The content data of the grid we are going to render
     *
     * @return string
     */
    public function renderGridLayoutTable($layoutSetup, $row, $head, $gridContent)
    {
        $specificIds = $this->helper->getSpecificIds($row);
        $grid = '<div class="t3-grid-container t3-grid-element-container' . ($layoutSetup['frame'] ? ' t3-grid-container-framed t3-grid-container-' . $layoutSetup['frame'] : '') . ($layoutSetup['top_level_layout'] ? ' t3-grid-tl-container' : '') . '">';
        if ($layoutSetup['frame'] || $this->helper->getBackendUser()->uc['showGridInformation'] === 1) {
            $grid .= '<h4 class="t3-grid-container-title-' . (int) $layoutSetup['frame'] . '">' . BackendUtility::wrapInHelp('tx_gridelements_backend_layouts', 'title', $this->languageService->sL($layoutSetup['title']), array('title' => $this->languageService->sL($layoutSetup['title']), 'description' => $this->languageService->sL($layoutSetup['description']))) . '</h4>';
        }
        $grid .= '<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" class="t3-page-columns t3-grid-table">';
        // add colgroups
        $colCount = 0;
        $rowCount = 0;
        if (isset($layoutSetup['config'])) {
            if (isset($layoutSetup['config']['colCount'])) {
                $colCount = (int) $layoutSetup['config']['colCount'];
            }
            if (isset($layoutSetup['config']['rowCount'])) {
                $rowCount = (int) $layoutSetup['config']['rowCount'];
            }
        }
        $grid .= '<colgroup>';
        for ($i = 0; $i < $colCount; $i++) {
            $grid .= '<col style="width:' . 100 / $colCount . '%"></col>';
        }
        $grid .= '</colgroup>';
        // cycle through rows
        for ($layoutRow = 1; $layoutRow <= $rowCount; $layoutRow++) {
            $rowConfig = $layoutSetup['config']['rows.'][$layoutRow . '.'];
            if (!isset($rowConfig)) {
                continue;
            }
            $grid .= '<tr>';
            for ($col = 1; $col <= $colCount; $col++) {
                $columnConfig = $rowConfig['columns.'][$col . '.'];
                if (!isset($columnConfig)) {
                    continue;
                }
                // which column should be displayed inside this cell
                $columnKey = isset($columnConfig['colPos']) && $columnConfig['colPos'] !== '' ? (int) $columnConfig['colPos'] : 32768;
                // allowed CTypes
                $allowedContentTypes = array();
                if (!empty($columnConfig['allowed'])) {
                    $allowedContentTypes = array_flip(GeneralUtility::trimExplode(',', $columnConfig['allowed']));
                    if (!isset($allowedContentTypes['*'])) {
                        foreach ($allowedContentTypes as $key => &$ctype) {
                            $ctype = 't3-allow-' . $key;
                        }
                    } else {
                        unset($allowedContentTypes);
                    }
                }
                if (!empty($columnConfig['allowedGridTypes'])) {
                    $allowedGridTypes = array_flip(GeneralUtility::trimExplode(',', $columnConfig['allowedGridTypes']));
                    if (!isset($allowedGridTypes['*']) && !empty($allowedGridTypes)) {
                        foreach ($allowedGridTypes as $gridType => &$gridTypeClass) {
                            $gridTypeClass = 't3-allow-gridtype t3-allow-gridtype-' . $gridType;
                        }
                        $allowedContentTypes['gridelements_pi1'] = 't3-allow-gridelements_pi1';
                    } else {
                        if (!empty($allowedContentTypes)) {
                            $allowedContentTypes['gridelements_pi1'] = 't3-allow-gridelements_pi1';
                        }
                        unset($allowedGridTypes);
                    }
                }
                // render the grid cell
                $colSpan = (int) $columnConfig['colspan'];
                $rowSpan = (int) $columnConfig['rowspan'];
                $expanded = $this->helper->getBackendUser()->uc['moduleData']['page']['gridelementsCollapsedColumns'][$row['uid'] . '_' . $columnKey] ? 'collapsed' : 'expanded';
                $grid .= '<td valign="top"' . (isset($columnConfig['colspan']) ? ' colspan="' . $colSpan . '"' : '') . (isset($columnConfig['rowspan']) ? ' rowspan="' . $rowSpan . '"' : '') . 'data-colpos="' . $columnKey . '" data-columnkey="' . $specificIds['uid'] . '_' . $columnKey . '"
					class="t3-grid-cell t3js-page-column t3-page-column t3-page-column-' . $columnKey . (!isset($columnConfig['colPos']) || $columnConfig['colPos'] === '' ? ' t3-grid-cell-unassigned' : '') . (isset($columnConfig['colspan']) && $columnConfig['colPos'] !== '' ? ' t3-grid-cell-width' . $colSpan : '') . (isset($columnConfig['rowspan']) && $columnConfig['colPos'] !== '' ? ' t3-grid-cell-height' . $rowSpan : '') . ' ' . ($layoutSetup['horizontal'] ? ' t3-grid-cell-horizontal' : '') . (!empty($allowedContentTypes) ? ' ' . join(' ', $allowedContentTypes) : ' t3-allow-all') . (!empty($allowedGridTypes) ? ' ' . join(' ', $allowedGridTypes) : '') . ' ' . $expanded . '" data-state="' . $expanded . '">';
                $grid .= ($this->helper->getBackendUser()->uc['hideColumnHeaders'] ? '' : $head[$columnKey]) . $gridContent[$columnKey];
                $grid .= '</td>';
            }
            $grid .= '</tr>';
        }
        $grid .= '</table></div>';
        return $grid;
    }
 /**
  * Get localized label
  *
  * @param string $key
  * @return string
  */
 protected function getLabel($key)
 {
     return $this->languageService->sL($this->locallangPath . 'flexform.main.' . $key, true);
 }
Exemplo n.º 19
0
 /**
  * Wraps the "splitLabel function" of the language object.
  *
  * @param string $reference: Reference/key of the label
  * @param bool $useHtmlSpecialChar: Convert special chars to HTML entities (default: FALSE)
  * @return string The label of the reference/key to be fetched
  */
 protected function sL($reference, $useHtmlSpecialChar = false)
 {
     return $this->langObject->sL($reference, $useHtmlSpecialChar);
 }
 /**
  * Adding a new content element wizard item for powermail
  *
  * @param array $contentElementWizardItems
  * @return array
  */
 public function proc($contentElementWizardItems = array())
 {
     $this->initialize();
     $contentElementWizardItems['plugins_tx_powermail_pi1'] = array('icon' => ExtensionManagementUtility::extRelPath('powermail') . 'Resources/Public/Icons/ce_wiz.gif', 'title' => $this->languageService->sL($this->locallangPath . 'pluginWizardTitle', true), 'description' => $this->languageService->sL($this->locallangPath . 'pluginWizardDescription', true), 'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=powermail_pi1', 'tt_content_defValues' => array('CType' => 'list'));
     return $contentElementWizardItems;
 }
Exemplo n.º 21
0
 /**
  * @param LanguageService $languageService
  * @param FlashMessageQueue $messageQueue
  * @param bool $isAjaxCall
  * @internal Only public to be used in tests
  * @return \Closure
  */
 public static function getMessageClosure(LanguageService $languageService, FlashMessageQueue $messageQueue, $isAjaxCall)
 {
     return function () use($languageService, $messageQueue, $isAjaxCall) {
         /** @var \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage */
         $flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, $languageService->sL('LLL:EXT:lang/locallang_core.xlf:error.formProtection.tokenInvalid'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, !$isAjaxCall);
         $messageQueue->enqueue($flashMessage);
     };
 }
Exemplo n.º 22
0
 /**
  * Add captcha option
  *
  * @param array $params
  * @return void
  */
 protected function addCaptchaOption(&$params)
 {
     if (ExtensionManagementUtility::isLoaded('sr_freecap')) {
         $params['items'][] = [$this->languageService->sL($this->localLangPrefix . 'tx_femanager_domain_model_user.captcha'), 'captcha'];
     }
 }
Exemplo n.º 23
0
 /**
  * Get label from locallang_core.xlf:cm.*
  *
  * @param string $label The "cm."-suffix to get.
  * @return string
  */
 public function label($label)
 {
     return $this->languageService->makeEntities($this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:cm.' . $label, true));
 }
 /**
  * Renders the link attributes for the selected link handler
  *
  * @return string
  */
 public function renderLinkAttributeFields()
 {
     // Processing the classes configuration
     if (!empty($this->buttonConfig['properties.']['class.']['allowedClasses'])) {
         $classesAnchorArray = GeneralUtility::trimExplode(',', $this->buttonConfig['properties.']['class.']['allowedClasses'], true);
         // Collecting allowed classes and configured default values
         $classesAnchor = ['all' => []];
         $titleReadOnly = $this->buttonConfig['properties.']['title.']['readOnly'] || $this->buttonConfig[$this->currentLinkHandlerId . '.']['properties.']['title.']['readOnly'];
         if (is_array($this->RTEProperties['classesAnchor.'])) {
             foreach ($this->RTEProperties['classesAnchor.'] as $label => $conf) {
                 if (in_array($conf['class'], $classesAnchorArray)) {
                     $classesAnchor['all'][] = $conf['class'];
                     if ($conf['type'] === $this->displayedLinkHandlerId) {
                         $classesAnchor[$conf['type']][] = $conf['class'];
                         if ($this->buttonConfig[$conf['type'] . '.']['properties.']['class.']['default'] == $conf['class']) {
                             $this->classesAnchorDefault[$conf['type']] = $conf['class'];
                             if ($conf['titleText']) {
                                 $this->classesAnchorDefaultTitle[$conf['type']] = $this->contentLanguageService->sL(trim($conf['titleText']));
                             }
                             if (isset($conf['target'])) {
                                 $this->classesAnchorDefaultTarget[$conf['type']] = trim($conf['target']);
                             }
                         }
                     }
                     if ($titleReadOnly && $conf['titleText']) {
                         $this->classesAnchorClassTitle[$conf['class']] = $this->classesAnchorDefaultTitle[$conf['type']] = $this->contentLanguageService->sL(trim($conf['titleText']));
                     }
                 }
             }
         }
         // Constructing the class selector options
         foreach ($classesAnchorArray as $class) {
             if (!in_array($class, $classesAnchor['all']) || in_array($class, $classesAnchor['all']) && is_array($classesAnchor[$this->displayedLinkHandlerId]) && in_array($class, $classesAnchor[$this->displayedLinkHandlerId])) {
                 $selected = '';
                 if ($this->linkAttributeValues['class'] === $class || !$this->linkAttributeValues['class'] && $this->classesAnchorDefault[$this->displayedLinkHandlerId] == $class) {
                     $selected = 'selected="selected"';
                 }
                 $classLabel = !empty($this->RTEProperties['classes.'][$class . '.']['name']) ? $this->getPageConfigLabel($this->RTEProperties['classes.'][$class . '.']['name'], 0) : $class;
                 $classStyle = !empty($this->RTEProperties['classes.'][$class . '.']['value']) ? $this->RTEProperties['classes.'][$class . '.']['value'] : '';
                 $this->classesAnchorJSOptions[$this->displayedLinkHandlerId] .= '<option ' . $selected . ' value="' . $class . '"' . ($classStyle ? ' style="' . $classStyle . '"' : '') . '>' . $classLabel . '</option>';
             }
         }
         if ($this->classesAnchorJSOptions[$this->displayedLinkHandlerId] && !($this->buttonConfig['properties.']['class.']['required'] || $this->buttonConfig[$this->currentLinkHandlerId . '.']['properties.']['class.']['required'])) {
             $selected = '';
             if (!$this->linkAttributeValues['class'] && !$this->classesAnchorDefault[$this->displayedLinkHandlerId]) {
                 $selected = 'selected="selected"';
             }
             $this->classesAnchorJSOptions[$this->displayedLinkHandlerId] = '<option ' . $selected . ' value=""></option>' . $this->classesAnchorJSOptions[$this->displayedLinkHandlerId];
         }
     }
     // Default target
     $this->defaultLinkTarget = $this->classesAnchorDefault[$this->currentLinkHandlerId] && $this->classesAnchorDefaultTarget[$this->currentLinkHandlerId] ? $this->classesAnchorDefaultTarget[$this->currentLinkHandlerId] : (isset($this->buttonConfig[$this->currentLinkHandlerId . '.']['properties.']['target.']['default']) ? $this->buttonConfig[$this->currentLinkHandlerId . '.']['properties.']['target.']['default'] : (isset($this->buttonConfig['properties.']['target.']['default']) ? $this->buttonConfig['properties.']['target.']['default'] : ''));
     // Initializing additional attributes
     if ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Link']['additionalAttributes']) {
         $addAttributes = GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rtehtmlarea']['plugins']['TYPO3Link']['additionalAttributes'], true);
         foreach ($addAttributes as $attribute) {
             $this->additionalAttributes[$attribute] = isset($this->linkAttributeValues[$attribute]) ? $this->linkAttributeValues[$attribute] : '';
         }
     }
     return parent::renderLinkAttributeFields();
 }
Exemplo n.º 25
0
 /**
  * Get label from locallang_core.xlf:cm.*
  *
  * @param string $label The "cm."-suffix to get.
  * @return string
  */
 public function label($label)
 {
     return htmlspecialchars($this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:cm.' . $label));
 }
Exemplo n.º 26
0
 /**
  * Get security status of loaded and installed extensions
  *
  * @return \stdClass with properties 'loaded' and 'existing' containing a TYPO3\CMS\Reports\Report\Status\Status object
  */
 protected function getSecurityStatusOfExtensions()
 {
     $extensionInformation = $this->listUtility->getAvailableAndInstalledExtensionsWithAdditionalInformation();
     $loadedInsecure = array();
     $existingInsecure = array();
     $loadedOutdated = array();
     $existingOutdated = array();
     foreach ($extensionInformation as $extensionKey => $information) {
         if (array_key_exists('terObject', $information) && $information['terObject'] instanceof \TYPO3\CMS\Extensionmanager\Domain\Model\Extension) {
             /** @var $terObject \TYPO3\CMS\Extensionmanager\Domain\Model\Extension */
             $terObject = $information['terObject'];
             $insecureStatus = $terObject->getReviewState();
             if ($insecureStatus === -1) {
                 if (array_key_exists('installed', $information) && $information['installed'] === TRUE) {
                     $loadedInsecure[] = array('extensionKey' => $extensionKey, 'version' => $terObject->getVersion());
                 } else {
                     $existingInsecure[] = array('extensionKey' => $extensionKey, 'version' => $terObject->getVersion());
                 }
             } elseif ($insecureStatus === -2) {
                 if (array_key_exists('installed', $information) && $information['installed'] === TRUE) {
                     $loadedOutdated[] = array('extensionKey' => $extensionKey, 'version' => $terObject->getVersion());
                 } else {
                     $existingOutdated[] = array('extensionKey' => $extensionKey, 'version' => $terObject->getVersion());
                 }
             }
         }
     }
     $result = new \stdClass();
     if (count($loadedInsecure) === 0) {
         $value = $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedExtensions.noInsecureExtensionLoaded.value');
         $message = '';
         $severity = \TYPO3\CMS\Reports\Status::OK;
     } else {
         $value = sprintf($this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedExtensions.insecureExtensionLoaded.value'), count($loadedInsecure));
         $extensionList = array();
         foreach ($loadedInsecure as $insecureExtension) {
             $extensionList[] = sprintf($this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedExtensions.insecureExtensionLoaded.message.extension'), $insecureExtension['extensionKey'], $insecureExtension['version']);
         }
         $message = sprintf($this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedExtensions.insecureExtensionLoaded.message'), implode('', $extensionList));
         $severity = \TYPO3\CMS\Reports\Status::ERROR;
     }
     $result->loaded = $this->objectManager->get('TYPO3\\CMS\\Reports\\Status', $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedExtensions.title'), $value, $message, $severity);
     if (count($existingInsecure) === 0) {
         $value = $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingExtensions.noInsecureExtensionExists.value');
         $message = '';
         $severity = \TYPO3\CMS\Reports\Status::OK;
     } else {
         $value = sprintf($this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingExtensions.insecureExtensionExists.value'), count($existingInsecure));
         $extensionList = array();
         foreach ($existingInsecure as $insecureExtension) {
             $extensionList[] = sprintf($this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingExtensions.insecureExtensionExists.message.extension'), $insecureExtension['extensionKey'], $insecureExtension['version']);
         }
         $message = sprintf($this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingExtensions.insecureExtensionExists.message'), implode('', $extensionList));
         $severity = \TYPO3\CMS\Reports\Status::WARNING;
     }
     $result->existing = $this->objectManager->get('TYPO3\\CMS\\Reports\\Status', $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingExtensions.title'), $value, $message, $severity);
     if (count($loadedOutdated) === 0) {
         $value = $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedOutdatedExtensions.noOutdatedExtensionLoaded.value');
         $message = '';
         $severity = \TYPO3\CMS\Reports\Status::OK;
     } else {
         $value = sprintf($this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedOutdatedExtensions.outdatedExtensionLoaded.value'), count($loadedOutdated));
         $extensionList = array();
         foreach ($loadedOutdated as $outdatedExtension) {
             $extensionList[] = sprintf($this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedOutdatedExtensions.outdatedExtensionLoaded.message.extension'), $outdatedExtension['extensionKey'], $outdatedExtension['version']);
         }
         $message = sprintf($this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedOutdatedExtensions.outdatedExtensionLoaded.message'), implode('', $extensionList));
         $severity = \TYPO3\CMS\Reports\Status::WARNING;
     }
     $result->loadedoutdated = $this->objectManager->get('TYPO3\\CMS\\Reports\\Status', $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedOutdatedExtensions.title'), $value, $message, $severity);
     if (count($existingOutdated) === 0) {
         $value = $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingOutdatedExtensions.noOutdatedExtensionExists.value');
         $message = '';
         $severity = \TYPO3\CMS\Reports\Status::OK;
     } else {
         $value = sprintf($this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingOutdatedExtensions.outdatedExtensionExists.value'), count($existingOutdated));
         $extensionList = array();
         foreach ($existingOutdated as $outdatedExtension) {
             $extensionList[] = sprintf($this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingOutdatedExtensions.outdatedExtensionExists.message.extension'), $outdatedExtension['extensionKey'], $outdatedExtension['version']);
         }
         $message = sprintf($this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingOutdatedExtensions.outdatedExtensionExists.message'), implode('', $extensionList));
         $severity = \TYPO3\CMS\Reports\Status::WARNING;
     }
     $result->existingoutdated = $this->objectManager->get('TYPO3\\CMS\\Reports\\Status', $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingOutdatedExtensions.title'), $value, $message, $severity);
     return $result;
 }
Exemplo n.º 27
0
    /**
     * Create configuration form
     *
     * @param array $inData Form configuration data
     * @return void
     */
    public function makeConfigurationForm($inData)
    {
        $nameSuggestion = '';
        // Page tree export options:
        if (isset($inData['pagetree']['id'])) {
            $this->standaloneView->assign('treeHTML', $this->treeHTML);
            $opt = array('-2' => $this->lang->getLL('makeconfig_tablesOnThisPage'), '-1' => $this->lang->getLL('makeconfig_expandedTree'), '0' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_0'), '1' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_1'), '2' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_2'), '3' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_3'), '4' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_4'), '999' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_infi'));
            $this->standaloneView->assign('levelSelectOptions', $opt);
            $this->standaloneView->assign('tableSelectOptions', $this->getTableSelectOptions('pages'));
            $nameSuggestion .= 'tree_PID' . $inData['pagetree']['id'] . '_L' . $inData['pagetree']['levels'];
        }
        // Single record export:
        if (is_array($inData['record'])) {
            $records = array();
            foreach ($inData['record'] as $ref) {
                $rParts = explode(':', $ref);
                $tName = $rParts[0];
                $rUid = $rParts[1];
                $nameSuggestion .= $tName . '_' . $rUid;
                $rec = BackendUtility::getRecordWSOL($tName, $rUid);
                if (!empty($rec)) {
                    $records[] = '
					<tr class="bgColor4">
						<td><strong>' . $this->lang->getLL('makeconfig_record', true) . '</strong></td>
						<td>' . $this->iconFactory->getIconForRecord($tName, $rec, Icon::SIZE_SMALL)->render() . BackendUtility::getRecordTitle($tName, $rec, true) . '<input type="hidden" name="tx_impexp[record][]" value="' . htmlspecialchars($tName . ':' . $rUid) . '" /></td>
					</tr>';
                }
            }
            $this->standaloneView->assign('records', implode('', $records));
        }
        // Single tables/pids:
        if (is_array($inData['list'])) {
            // Display information about pages from which the export takes place
            $tblList = '';
            foreach ($inData['list'] as $reference) {
                $referenceParts = explode(':', $reference);
                $tableName = $referenceParts[0];
                if ($this->getBackendUser()->check('tables_select', $tableName)) {
                    // If the page is actually the root, handle it differently
                    // NOTE: we don't compare integers, because the number actually comes from the split string above
                    if ($referenceParts[1] === '0') {
                        $iconAndTitle = $this->iconFactory->getIcon('apps-pagetree-root', Icon::SIZE_SMALL)->render() . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
                    } else {
                        $record = BackendUtility::getRecordWSOL('pages', $referenceParts[1]);
                        $iconAndTitle = $this->iconFactory->getIconForRecord('pages', $record, Icon::SIZE_SMALL)->render() . BackendUtility::getRecordTitle('pages', $record, true);
                    }
                    $tblList .= 'Table "' . $tableName . '" from ' . $iconAndTitle . '<input type="hidden" name="tx_impexp[list][]" value="' . htmlspecialchars($reference) . '" /><br/>';
                }
            }
            $this->standaloneView->assign('tableList', $tblList);
        }
        $this->standaloneView->assign('externalReferenceTableSelectOptions', $this->getTableSelectOptions());
        $this->standaloneView->assign('externalStaticTableSelectOptions', $this->getTableSelectOptions());
        // Exclude:
        $excludeHiddenFields = '';
        if (is_array($inData['exclude'])) {
            foreach ($inData['exclude'] as $key => $value) {
                $excludeHiddenFields .= '<input type="hidden" name="tx_impexp[exclude][' . $key . ']" value="1" />';
            }
            $this->standaloneView->assign('excludedKeys', implode(', ', array_keys($inData['exclude'])));
        }
        $this->standaloneView->assign('nameSuggestion', $nameSuggestion);
    }
 /**
  * Adding a new content element wizard item for powermail
  *
  * @param array $contentElementWizardItems
  * @return array
  */
 function proc($wizardItems)
 {
     $this->initialize();
     $wizardItems['plugins_tx_jsfaq_faq'] = array('icon' => ExtensionManagementUtility::extRelPath('js_faq') . 'Resources/Public/Icons/wizard_icon.png', 'title' => $this->languageService->sL($this->locallangPath . 'plugin-title', TRUE), 'description' => $this->languageService->sL($this->locallangPath . 'plugin-description', TRUE), 'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=jsfaq_faq', 'tt_content_defValues' => array('CType' => 'list'));
     return $wizardItems;
 }
Exemplo n.º 29
0
 /**
  * Renders the grid layout table after the HTML content for the single elements has been rendered
  *
  * @param array $layoutSetup : The setup of the layout that is selected for the grid we are going to render
  * @param array $row : The current data row for the container item
  * @param array $head : The data for the column headers of the grid we are going to render
  * @param array $gridContent : The content data of the grid we are going to render
  *
  * @return string
  */
 public function renderGridLayoutTable($layoutSetup, $row, $head, $gridContent)
 {
     $specificIds = Helper::getInstance()->getSpecificIds($row);
     $grid = '<div class="t3-gridContainer' . ($layoutSetup['frame'] ? ' t3-gridContainer-framed t3-gridContainer-' . $layoutSetup['frame'] : '') . ($layoutSetup['top_level_layout'] ? ' t3-gridTLContainer' : '') . '">';
     if ($layoutSetup['frame']) {
         $grid .= '<h4 class="t3-gridContainer-title-' . $layoutSetup['frame'] . '">' . $this->lang->sL($layoutSetup['title'], TRUE) . '</h4>';
     }
     if ($GLOBALS['BE_USER']->uc['showGridInformation'] === 1) {
         $grid .= '<span class="t3-help-link" href="#" data-title="' . htmlspecialchars($this->lang->sL($layoutSetup['title'])) . '" data-description="' . htmlspecialchars($this->lang->sL($layoutSetup['description'])) . '"><abbr class="t3-help-teaser">' . $this->lang->sL($layoutSetup['title'], TRUE) . '</abbr></span>';
     }
     $grid .= '<table border="0" cellspacing="1" cellpadding="4" width="100%" height="100%" class="t3-page-columns t3-gridTable">';
     // add colgroups
     $colCount = 0;
     $rowCount = 0;
     if (isset($layoutSetup['config'])) {
         if (isset($layoutSetup['config']['colCount'])) {
             $colCount = (int) $layoutSetup['config']['colCount'];
         }
         if (isset($layoutSetup['config']['rowCount'])) {
             $rowCount = (int) $layoutSetup['config']['rowCount'];
         }
     }
     $grid .= '<colgroup>';
     for ($i = 0; $i < $colCount; $i++) {
         $grid .= '<col style="width:' . 100 / $colCount . '%"></col>';
     }
     $grid .= '</colgroup>';
     // cycle through rows
     for ($layoutRow = 1; $layoutRow <= $rowCount; $layoutRow++) {
         $rowConfig = $layoutSetup['config']['rows.'][$layoutRow . '.'];
         if (!isset($rowConfig)) {
             continue;
         }
         $grid .= '<tr>';
         for ($col = 1; $col <= $colCount; $col++) {
             $columnConfig = $rowConfig['columns.'][$col . '.'];
             if (!isset($columnConfig)) {
                 continue;
             }
             // which column should be displayed inside this cell
             $columnKey = $columnConfig['colPos'] !== '' ? (int) $columnConfig['colPos'] : 32768;
             // allowed CTypes
             if (!empty($columnConfig['allowed'])) {
                 $allowedCTypes = array_flip(GeneralUtility::trimExplode(',', $columnConfig['allowed']));
                 if (!isset($allowedCTypes['*'])) {
                     foreach ($allowedCTypes as $ctype => &$ctypeClass) {
                         $ctypeClass = 't3-allow-' . $ctype;
                     }
                 } else {
                     unset($allowedCTypes);
                 }
             }
             if (!empty($columnConfig['allowedGridTypes'])) {
                 $allowedGridTypes = array_flip(GeneralUtility::trimExplode(',', $columnConfig['allowedGridTypes']));
                 if (!isset($allowedGridTypes['*'])) {
                     foreach ($allowedGridTypes as $gridType => &$gridTypeClass) {
                         $gridTypeClass = 't3-allow-gridtype-' . $gridType;
                     }
                     $allowedCTypes['gridelements_pi1'] = 't3-allow-gridelements_pi1';
                 } else {
                     if (isset($allowedCTypes)) {
                         $allowedCTypes['gridelements_pi1'] = 't3-allow-gridelements_pi1';
                     }
                     unset($allowedGridTypes);
                 }
             }
             // render the grid cell
             $colSpan = (int) $columnConfig['colspan'];
             $rowSpan = (int) $columnConfig['rowspan'];
             $grid .= '<td valign="top"' . (isset($columnConfig['colspan']) ? ' colspan="' . $colSpan . '"' : '') . (isset($columnConfig['rowspan']) ? ' rowspan="' . $rowSpan . '"' : '') . 'id="column-' . $specificIds['uid'] . 'x' . $columnKey . '" class="t3-gridCell t3-page-column t3-page-column-' . $columnKey . (!isset($columnConfig['colPos']) || $columnConfig['colPos'] === '' ? ' t3-gridCell-unassigned' : '') . (isset($columnConfig['colspan']) && $columnConfig['colPos'] !== '' ? ' t3-gridCell-width' . $colSpan : '') . (isset($columnConfig['rowspan']) && $columnConfig['colPos'] !== '' ? ' t3-gridCell-height' . $rowSpan : '') . ' ' . ($layoutSetup['horizontal'] ? ' t3-gridCell-horizontal' : '') . (count($allowedCTypes) ? ' ' . join(' ', $allowedCTypes) : ' t3-allow-all') . (count($allowedGridTypes) ? ' ' . join(' ', $allowedGridTypes) : '') . '">';
             $grid .= ($GLOBALS['BE_USER']->uc['hideColumnHeaders'] ? '' : $head[$columnKey]) . $gridContent[$columnKey];
             $grid .= '</td>';
         }
         $grid .= '</tr>';
     }
     $grid .= '</table></div>';
     return $grid;
 }
Exemplo n.º 30
0
 /**
  * Add captcha option
  *
  * @param array $params
  * @return void
  */
 protected function addCaptchaOption(&$params)
 {
     if (ExtensionManagementUtility::isLoaded('sr_freecap')) {
         $params['items'][] = array($this->languageService->sL('LLL:EXT:femanager/Resources/Private/Language/locallang_db.xlf:tx_femanager_domain_model_user.captcha'), 'captcha');
     }
 }