/** * MAIN function for page information of localization * * @return string Output HTML for the module. * @todo Define visibility */ public function main() { global $BACK_PATH, $LANG, $SOBE; $theOutput = $this->pObj->doc->header($LANG->sL('LLL:EXT:cms/web_info/locallang.xlf:lang_title')); if ($this->pObj->id) { // Depth selector: $h_func = BackendUtility::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth']); $h_func .= BackendUtility::getFuncMenu($this->pObj->id, 'SET[lang]', $this->pObj->MOD_SETTINGS['lang'], $this->pObj->MOD_MENU['lang']); $theOutput .= $h_func; // Add CSH: $theOutput .= BackendUtility::cshItem('_MOD_web_info', 'lang', $GLOBALS['BACK_PATH'], '|<br />'); // Showing the tree: // Initialize starting point of page tree: $treeStartingPoint = (int) $this->pObj->id; $treeStartingRecord = BackendUtility::getRecordWSOL('pages', $treeStartingPoint); $depth = $this->pObj->MOD_SETTINGS['depth']; // Initialize tree object: $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\View\\PageTreeView'); $tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1)); $tree->addField('l18n_cfg'); // Creating top icon; the current page $HTML = IconUtility::getSpriteIconForRecord('pages', $treeStartingRecord); $tree->tree[] = array('row' => $treeStartingRecord, 'HTML' => $HTML); // Create the tree from starting point: if ($depth) { $tree->getTree($treeStartingPoint, $depth, ''); } // Render information table: $theOutput .= $this->renderL10nTable($tree); } return $theOutput; }
/** * MAIN function for page information display * * @return string Output HTML for the module. * @todo Define visibility */ public function main() { global $BACK_PATH, $LANG, $SOBE; $dblist = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\View\\PageLayoutView'); $dblist->descrTable = '_MOD_' . $GLOBALS['MCONF']['name']; $dblist->backPath = $BACK_PATH; $dblist->thumbs = 0; $dblist->script = 'index.php'; $dblist->showIcon = 0; $dblist->setLMargin = 0; $dblist->agePrefixes = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears'); $dblist->pI_showUser = 1; // PAGES: $this->pObj->MOD_SETTINGS['pages_levels'] = $this->pObj->MOD_SETTINGS['depth']; // ONLY for the sake of dblist module which uses this value. $h_func = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php'); $h_func .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, 'SET[pages]', $this->pObj->MOD_SETTINGS['pages'], $this->pObj->MOD_MENU['pages'], 'index.php'); $dblist->start($this->pObj->id, 'pages', 0); $dblist->generateList(); // CSH $theOutput .= $this->pObj->doc->header($LANG->getLL('page_title')); $theOutput .= $this->pObj->doc->section('', \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem($dblist->descrTable, 'pagetree_overview', $GLOBALS['BACK_PATH'], '|<br />') . $h_func . $dblist->HTMLcode, 0, 1); // Additional footer content $footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/web_info/class.tx_cms_webinfo.php']['drawFooterHook']; if (is_array($footerContentHook)) { foreach ($footerContentHook as $hook) { $params = array(); $theOutput .= \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($hook, $params, $this); } } return $theOutput; }
/** * Creates the module's content. In this case it rather acts as a kind of # * dispatcher redirecting requests to specific tasks. * * @return void */ public function main() { $docHeaderButtons = $this->getButtons(); $markers = array(); $this->doc->JScodeArray[] = ' script_ended = 0; function jumpToUrl(URL) { document.location = URL; } '; $this->doc->postCode = ' <script language="javascript" type="text/javascript"> script_ended = 1; if (top.fsMod) { top.fsMod.recentIds["web"] = 0; } </script> '; // Render content depending on the mode $mode = (string) $this->MOD_SETTINGS['mode']; if ($mode == 'information') { $this->renderInformationContent(); } else { $this->renderModuleContent(); } // Compile document $markers['FUNC_MENU'] = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(0, 'SET[mode]', $this->MOD_SETTINGS['mode'], $this->MOD_MENU['mode']); $markers['CONTENT'] = $this->content; // Build the <body> for the module $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); // Renders the module page $this->content = $this->doc->render($GLOBALS['LANG']->getLL('title'), $this->content); }
/** * Main function of the module. Write the content to $this->content * * @return void */ public function main() { $this->thisScript = BackendUtility::getModuleUrl($this->MCONF['name']); // Clean up settings: $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET'), $this->MCONF['name']); // Draw the header $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->form = '<form action="" method="post">'; // DBAL page title: $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title')); $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title')); $this->content .= $this->doc->spacer(5); $this->content .= $this->doc->section('', $this->doc->funcMenu('', BackendUtility::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']))); // Debug log: switch ($this->MOD_SETTINGS['function']) { case 'info': $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('Cached_info'), $this->printCachedInfo()); break; case 'sqlcheck': $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('SQL_check'), $this->printSqlCheck()); break; case 0: $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('Debug_log'), $this->printLogMgm()); break; } // ShortCut if ($GLOBALS['BE_USER']->mayMakeShortcut()) { $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name'])); } $this->content .= $this->doc->spacer(10); }
/** * Creation of the main content. Calling extObjContent() to trigger content generation from the sub-sub modules * * @return string The content * @todo Define visibility */ public function main() { global $SOBE, $LANG; $menu = $LANG->getLL('wiz_lWizards', TRUE) . ': ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, 'SET[wiz]', $this->pObj->MOD_SETTINGS['wiz'], $this->pObj->MOD_MENU['wiz']); $theOutput .= $this->pObj->doc->section('', '<span class="nobr">' . $menu . '</span>'); $content = ''; $content .= $theOutput; $content .= $this->pObj->doc->spacer(20); $content .= $this->extObjContent(); return $content; }
/** * Creation of the main content. Calling extObjContent() to trigger content generation from the sub-sub modules * * @return string The content */ public function main() { $menu = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, 'SET[wiz]', $this->pObj->MOD_SETTINGS['wiz'], $this->pObj->MOD_MENU['wiz']); $content = ''; if (!empty($menu)) { $menu = $GLOBALS['LANG']->getLL('wiz_lWizards', true) . ': ' . $menu; $content = $this->pObj->doc->section('', '<span class="text-nowrap">' . $menu . '</span>'); $content .= $this->pObj->doc->spacer(20); } $content .= $this->extObjContent(); return $content; }
/** * Initialize module header etc and call extObjContent function * * @return void * @todo Define visibility */ public function main() { global $LANG, $BACK_PATH; // Access check... // The page will show only if there is a valid page and if this page may be viewed by the user $this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; // Template markers $markers = array('CSH' => '', 'FUNC_MENU' => '', 'CONTENT' => ''); $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate'); $this->doc->backPath = $BACK_PATH; $this->doc->setModuleTemplate('templates/func.html'); // Main if ($this->id && $access) { // JavaScript $this->doc->JScode = $this->doc->wrapScriptTags(' script_ended = 0; function jumpToUrl(URL) { // window.location.href = URL; } '); $this->doc->postCode = $this->doc->wrapScriptTags(' script_ended = 1; if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . '; '); // Setting up the context sensitive menu: $this->doc->getContextMenuCode(); $this->doc->form = '<form action="index.php" method="post"><input type="hidden" name="id" value="' . $this->id . '" />'; $vContent = $this->doc->getVersionSelector($this->id, 1); if ($vContent) { $this->content .= $this->doc->section('', $vContent); } $this->extObjContent(); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CSH'] = $docHeaderButtons['csh']; $markers['FUNC_MENU'] = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']); $markers['CONTENT'] = $this->content; } else { // If no access or if ID == zero $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $LANG->getLL('clickAPage_content'), $LANG->getLL('title'), \TYPO3\CMS\Core\Messaging\FlashMessage::INFO); $this->content = $flashMessage->render(); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CSH'] = $docHeaderButtons['csh']; $markers['CONTENT'] = $this->content; } // Build the <body> for the module $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); // Renders the module page $this->content = $this->doc->render($LANG->getLL('title'), $this->content); }
public function main() { global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS, $TYPO3_DB; $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; $this->pageId = $this->pageinfo['uid']; if ($this->id && $access || $BE_USER->user['admin'] && !$this->id) { // Draw the header. $this->doc = GeneralUtility::makeInstance('template'); $this->doc->backPath = $BACK_PATH; $this->doc->form = '<form action="mod.php?M=web_txvalidateurlsM1" method="POST">'; // JavaScript $this->doc->JScode = ' <script language="javascript" type="text/javascript"> script_ended = 0; function jumpToUrl(URL) { document.location = URL; } </script> '; $this->doc->postCode = ' <script language="javascript" type="text/javascript"> script_ended = 1; if (top.fsMod) top.fsMod.recentIds["web"] = 0; </script> '; $headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . GeneralUtility::fixed_lgd_cs($this->pageinfo['_thePath'], 50); $this->content .= $this->doc->startPage($LANG->getLL('title')); $this->content .= $this->doc->header($LANG->getLL('title')); $this->content .= $this->doc->spacer(5); $this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']))); $this->content .= $this->doc->divider(5); // Render content: $this->moduleContent(); // ShortCut if ($BE_USER->mayMakeShortcut()) { $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name'])); } $this->content .= $this->doc->spacer(10); $this->content .= '</div>'; } else { // If no access or if ID == zero $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate'); $this->doc->backPath = $BACK_PATH; $this->content .= $this->doc->startPage($LANG->getLL('title')); $this->content .= $this->doc->header($LANG->getLL('title')); $this->content .= $this->doc->spacer(5); $this->content .= $this->doc->spacer(10); } }
/** * Creation of the main content. Calling extObjContent() to trigger content generation from the sub-sub modules * * @return string The content */ public function main() { $menu = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, 'SET[wiz]', $this->pObj->MOD_SETTINGS['wiz'], $this->pObj->MOD_MENU['wiz']); $content = ''; if (!empty($menu)) { $menu = $GLOBALS['LANG']->getLL('wiz_lWizards', true) . ': ' . $menu; $content = '<div>'; $content .= '<span class="text-nowrap">' . $menu . '</span>'; $content .= '</div>'; $content .= '<div style="padding-top: 20px;"></div>'; } $content .= $this->extObjContent(); return $content; }
/** * Initialize module header etc and call extObjContent function * * @return void * @todo Define visibility */ public function main() { // Access check... // The page will show only if there is a valid page and if this page may be viewed by the user $this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; if ($this->id && $access || $GLOBALS['BE_USER']->user['admin'] && !$this->id) { $this->CALC_PERMS = $GLOBALS['BE_USER']->calcPerms($this->pageinfo); if ($GLOBALS['BE_USER']->user['admin'] && !$this->id) { $this->pageinfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0); } $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->setModuleTemplate('templates/info.html'); $this->doc->tableLayout = array('0' => array('0' => array('<td valign="top"><strong>', '</strong></td>'), 'defCol' => array('<td><img src="' . $this->doc->backPath . 'clear.gif" width="10" height="1" alt="" /></td><td valign="top"><strong>', '</strong></td>')), 'defRow' => array('0' => array('<td valign="top">', '</td>'), 'defCol' => array('<td><img src="' . $this->doc->backPath . 'clear.gif" width="10" height="1" alt="" /></td><td valign="top">', '</td>'))); // JavaScript $this->doc->JScode = $this->doc->wrapScriptTags(' script_ended = 0; function jumpToUrl(URL) { // window.location.href = URL; } '); $this->doc->postCode = $this->doc->wrapScriptTags(' script_ended = 1; if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . '; '); // Setting up the context sensitive menu: $this->doc->getContextMenuCode(); $this->doc->form = '<form action="index.php" method="post" name="webinfoForm">'; $vContent = $this->doc->getVersionSelector($this->id, 1); if ($vContent) { $this->content .= $this->doc->section('', $vContent); } $this->extObjContent(); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $this->content); // Build the <body> for the module $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); } else { // If no access or if ID == zero $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\MediumDocumentTemplate'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->content = $this->doc->header($GLOBALS['LANG']->getLL('title')); $this->content .= $this->doc->spacer(5); $this->content .= $this->doc->spacer(10); } // Renders the module page $this->content = $this->doc->render($GLOBALS['LANG']->getLL('title'), $this->content); }
/** * Main function of the module. * Write the content to $this->content */ function main() { // Access check! // The page will show only if there is a valid page and if this page may be viewed by the user $this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate'); $this->doc->backPath = $GLOBALS['BACK_PATH']; if ($this->id && $access || $GLOBALS['BE_USER']->user['admin'] && !$this->id) { // Draw the header. $this->doc->form = '<form action="" method="POST">'; // JavaScript $this->doc->JScode = ' <script language="javascript" type="text/javascript"> script_ended = 0; function jumpToUrl(URL) { document.location = URL; } </script> '; $this->doc->postCode = ' <script language="javascript" type="text/javascript"> script_ended = 1; if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . '; </script> '; $headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.path') . ': ' . GeneralUtility::fixed_lgd_cs($this->pageinfo['_thePath'], -50); $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title')); $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title')); $this->content .= $this->doc->spacer(5); $this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']))); $this->content .= $this->doc->divider(5); // Render content: $this->moduleContent(); // ShortCut if ($GLOBALS['BE_USER']->mayMakeShortcut()) { $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name'])); } $this->content .= $this->doc->spacer(10); } else { // If no access or if ID == zero $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title')); $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title')); $this->content .= $this->doc->spacer(5); $this->content .= $this->doc->spacer(10); } }
/** * Initialize module header etc and call extObjContent function * * @return void */ public function main() { // Access check... // The page will show only if there is a valid page and if this page may be viewed by the user $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause); $access = is_array($this->pageinfo); // Template markers $markers = array('CSH' => '', 'FUNC_MENU' => '', 'CONTENT' => ''); $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->setModuleTemplate('EXT:func/Resources/Private/Templates/func.html'); // Main if ($this->id && $access) { // JavaScript $this->doc->postCode = $this->doc->wrapScriptTags('if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int) $this->id . ';'); // Setting up the context sensitive menu: $this->doc->getContextMenuCode(); $this->doc->form = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('web_func')) . '" method="post"><input type="hidden" name="id" value="' . htmlspecialchars($this->id) . '" />'; $vContent = $this->doc->getVersionSelector($this->id, TRUE); if ($vContent) { $this->content .= $this->doc->section('', $vContent); } $this->extObjContent(); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CSH'] = $docHeaderButtons['csh']; $markers['FUNC_MENU'] = BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']); $markers['CONTENT'] = $this->content; } else { // If no access or if ID == zero $title = $this->getLanguageService()->getLL('title'); $message = $this->getLanguageService()->getLL('clickAPage_content'); $view = GeneralUtility::makeInstance(StandaloneView::class); $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:func/Resources/Private/Templates/InfoBox.html')); $view->assignMultiple(array('title' => $title, 'message' => $message, 'state' => InfoboxViewHelper::STATE_INFO)); $this->content = $view->render(); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CSH'] = $docHeaderButtons['csh']; $markers['CONTENT'] = $this->content; } // Build the <body> for the module $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); // Renders the module page $this->content = $this->doc->render($this->getLanguageService()->getLL('title'), $this->content); }
/** * Main function of the module. Write the content to $this->content * * @return void * @todo Define visibility */ public function main() { // Access check! $access = $GLOBALS['BE_USER']->check('modules', 'help_txtsconfighelpM1'); // Draw the header. $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->setModuleTemplate('templates/tsconfig_help.html'); if ($access || $GLOBALS['BE_USER']->user['admin']) { $this->doc->form = '<form action="" method="post">'; // JavaScript $this->doc->JScode = ' <script language="javascript" type="text/javascript"> script_ended = 0; function jumpToUrl(URL) { document.location = URL; } </script> '; $this->doc->postCode = ' <script language="javascript" type="text/javascript"> script_ended = 1; if (top.fsMod) top.fsMod.recentIds["web"] = 0; </script> '; $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title')); // Render content: $this->moduleContent(); $this->content .= $this->doc->spacer(10); $markers['FUNC_MENU'] = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']); } else { $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title')); $markers['FUNC_MENU'] = ''; } // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CSH'] = $docHeaderButtons['csh']; $markers['CONTENT'] = $this->content; // Build the <body> for the module $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); // Renders the module page $this->content = $this->doc->render($GLOBALS['LANG']->getLL('title'), $this->content); }
/** * Creates the module's content. In this case it rather acts as a kind of # * dispatcher redirecting requests to specific tasks. * * @return void */ public function main() { $docHeaderButtons = $this->getButtons(); $markers = array(); $this->doc->postCode = $this->doc->wrapScriptTags('if (top.fsMod) { top.fsMod.recentIds["web"] = 0; }'); // Render content depending on the mode $mode = (string) $this->MOD_SETTINGS['mode']; if ($mode == 'information') { $this->renderInformationContent(); } else { $this->renderModuleContent(); } // Compile document $markers['FUNC_MENU'] = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(0, 'SET[mode]', $this->MOD_SETTINGS['mode'], $this->MOD_MENU['mode']); $markers['CONTENT'] = $this->content; // Build the <body> for the module $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); // Renders the module page $this->content = $this->doc->render($GLOBALS['LANG']->getLL('title'), $this->content); }
/** * Main function to generate the content * * @return void * @todo Define visibility */ public function main() { $this->content = $this->doc->header('Indexing Engine Statistics'); $this->content .= $this->doc->spacer(5); switch ($this->MOD_SETTINGS['function']) { case 'stat': $this->content .= $this->doc->section('Records', $this->doc->table($this->getRecordsNumbers()), 0, 1); $this->content .= $this->doc->spacer(15); $this->content .= $this->doc->section('index_phash TYPES', $this->doc->table($this->getPhashTypes()), 1); $this->content .= $this->doc->spacer(15); break; case 'externalDocs': $this->content .= $this->doc->section('External documents', $this->doc->table($this->getPhashExternalDocs()), 0, 1); $this->content .= $this->doc->spacer(15); break; case 'typo3pages': $this->content .= $this->doc->section('TYPO3 Pages', $this->doc->table($this->getPhashT3pages()), 0, 1); $this->content .= $this->doc->spacer(15); break; } $docHeaderButtons = $this->getButtons(); $markers = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => BackendUtility::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $this->content); $this->content = $this->doc->startPage('Indexing Engine Statistics'); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Main function of the module. Write the content to $this->content * If you chose "web" as main module, you will need to consider the $this->id parameter which will contain the uid-number of the page clicked in the page tree * * @return [type] ... */ function main() { // Access check! // The page will show only if there is a valid page and if this page may be viewed by the user $this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; if ($this->id && $access || $GLOBALS['BE_USER']->user['admin'] && !$this->id) { // Draw the header. $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('mediumDoc'); $this->doc->backPath = $GLOBALS['BACK_PATH']; /** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */ $pageRenderer = $this->doc->getPageRenderer(); $pageRenderer->loadExtJS(); $pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . '../typo3/sysext/backend/Resources/Public/JavaScript/tceforms.js'); $pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . '../typo3/js/extjs/ux/Ext.ux.DateTimePicker.js'); // Define settings for Date Picker $typo3Settings = array('datePickerUSmode' => 0, 'dateFormat' => array('j.n.Y', 'j.n.Y G:i')); $pageRenderer->addInlineSettingArray('', $typo3Settings); // JavaScript $this->doc->JScode = ' <script language="javascript" type="text/javascript"> script_ended = 0; function jumpToUrl(URL) { document.location = URL; } </script> '; $this->doc->postCode = ' <script language="javascript" type="text/javascript"> script_ended = 1; if (top.fsMod) top.fsMod.recentIds["web"] = 0; </script> '; //$headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.path').': '.\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_pre($this->pageinfo['_thePath'],50); $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title')); $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title')); $this->content .= $this->doc->spacer(5); $this->content .= $this->doc->section('', $this->doc->funcMenu('', \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'], basename(PATH_thisScript)))); $this->content .= $this->doc->divider(5); $this->content .= $this->moduleContent(); // ShortCut if ($GLOBALS['BE_USER']->mayMakeShortcut()) { $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name'])); } $this->content .= $this->doc->spacer(10); } else { // If no access or if ID == zero $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('mediumDoc'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title')); $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title')); $this->content .= $this->doc->spacer(5); $this->content .= $GLOBALS['LANG']->getLL('no_id'); $this->content .= $this->doc->spacer(10); } }
/** * Rendering all other listings than QuickEdit * * @return string */ public function renderListContent() { $this->moduleTemplate->getPageRenderer()->loadJquery(); $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu'); /** @var $dbList \TYPO3\CMS\Backend\View\PageLayoutView */ $dbList = GeneralUtility::makeInstance(PageLayoutView::class); $dbList->thumbs = $this->imagemode; $dbList->no_noWrap = 1; $dbList->descrTable = $this->descrTable; $this->pointer = MathUtility::forceIntegerInRange($this->pointer, 0, 100000); $dbList->script = BackendUtility::getModuleUrl($this->moduleName); $dbList->showIcon = 0; $dbList->setLMargin = 0; $dbList->doEdit = $this->EDIT_CONTENT; $dbList->ext_CALC_PERMS = $this->CALC_PERMS; $dbList->agePrefixes = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears'); $dbList->id = $this->id; $dbList->nextThree = MathUtility::forceIntegerInRange($this->modTSconfig['properties']['editFieldsAtATime'], 0, 10); $dbList->option_newWizard = $this->modTSconfig['properties']['disableNewContentElementWizard'] ? 0 : 1; $dbList->defLangBinding = $this->modTSconfig['properties']['defLangBinding'] ? 1 : 0; if (!$dbList->nextThree) { $dbList->nextThree = 1; } $dbList->externalTables = $this->externalTables; // Create menu for selecting a table to jump to (this is, if more than just pages/tt_content elements are found on the page!) // also fills $dbList->activeTables $dbList->getTableMenu($this->id); // Initialize other variables: $tableOutput = array(); $tableJSOutput = array(); $CMcounter = 0; // Traverse the list of table names which has records on this page (that array is populated // by the $dblist object during the function getTableMenu()): foreach ($dbList->activeTables as $table => $value) { $h_func = ''; $h_func_b = ''; if (!isset($dbList->externalTables[$table])) { // Toggle hidden ContentElements $numberOfHiddenElements = $this->getNumberOfHiddenElements(); if ($numberOfHiddenElements > 0) { $h_func_b = ' <div class="checkbox"> <label for="checkTt_content_showHidden"> <input type="checkbox" id="checkTt_content_showHidden" class="checkbox" name="SET[tt_content_showHidden]" value="1" ' . ($this->MOD_SETTINGS['tt_content_showHidden'] ? 'checked="checked"' : '') . ' /> ' . $this->getLanguageService()->getLL('hiddenCE', true) . ' (<span class="t3js-hidden-counter">' . $numberOfHiddenElements . '</span>) </label> </div>'; } // Boolean: Display up/down arrows and edit icons for tt_content records $dbList->tt_contentConfig['showCommands'] = 1; // Boolean: Display info-marks or not $dbList->tt_contentConfig['showInfo'] = 1; // Setting up the tt_content columns to show: if (is_array($GLOBALS['TCA']['tt_content']['columns']['colPos']['config']['items'])) { $colList = array(); $tcaItems = GeneralUtility::callUserFunction(BackendLayoutView::class . '->getColPosListItemsParsed', $this->id, $this); foreach ($tcaItems as $temp) { $colList[] = $temp[1]; } } else { // ... should be impossible that colPos has no array. But this is the fallback should it make any sense: $colList = array('1', '0', '2', '3'); } if ($this->colPosList !== '') { $colList = array_intersect(GeneralUtility::intExplode(',', $this->colPosList), $colList); } // The order of the rows: Default is left(1), Normal(0), right(2), margin(3) $dbList->tt_contentConfig['cols'] = implode(',', $colList); $dbList->tt_contentConfig['activeCols'] = $this->activeColPosList; $dbList->tt_contentConfig['showHidden'] = $this->MOD_SETTINGS['tt_content_showHidden']; $dbList->tt_contentConfig['sys_language_uid'] = (int) $this->current_sys_language; // If the function menu is set to "Language": if ($this->MOD_SETTINGS['function'] == 2) { $dbList->tt_contentConfig['languageMode'] = 1; $dbList->tt_contentConfig['languageCols'] = $this->MOD_MENU['language']; $dbList->tt_contentConfig['languageColsPointer'] = $this->current_sys_language; } } else { if (isset($this->MOD_SETTINGS) && isset($this->MOD_MENU)) { $h_func = BackendUtility::getFuncMenu($this->id, 'SET[' . $table . ']', $this->MOD_SETTINGS[$table], $this->MOD_MENU[$table], '', ''); } } // Start the dblist object: $dbList->itemsLimitSingleTable = 1000; $dbList->start($this->id, $table, $this->pointer, $this->search_field, $this->search_levels, $this->showLimit); $dbList->counter = $CMcounter; $dbList->ext_function = $this->MOD_SETTINGS['function']; // Render versioning selector: $dbList->HTMLcode .= $this->moduleTemplate->getVersionSelector($this->id); // Generate the list of elements here: $dbList->generateList(); // Adding the list content to the tableOutput variable: $tableOutput[$table] = $h_func . $dbList->HTMLcode . $h_func_b; // ... and any accumulated JavaScript goes the same way! $tableJSOutput[$table] = $dbList->JScode; // Increase global counter: $CMcounter += $dbList->counter; // Reset variables after operation: $dbList->HTMLcode = ''; $dbList->JScode = ''; } // END: traverse tables // For Context Sensitive Menus: // Init the content $content = ''; // Additional header content $headerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawHeaderHook']; if (is_array($headerContentHook)) { foreach ($headerContentHook as $hook) { $params = array(); $content .= GeneralUtility::callUserFunction($hook, $params, $this); } } // Add the content for each table we have rendered (traversing $tableOutput variable) foreach ($tableOutput as $table => $output) { $content .= $output; } // Making search form: if (!$this->modTSconfig['properties']['disableSearchBox'] && !empty($tableOutput)) { $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ToggleSearchToolbox'); $toggleSearchFormButton = $this->buttonBar->makeLinkButton()->setClasses('t3js-toggle-search-toolbox')->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.title.searchIcon', true))->setIcon($this->iconFactory->getIcon('actions-search', Icon::SIZE_SMALL))->setHref('#'); $this->buttonBar->addButton($toggleSearchFormButton, ButtonBar::BUTTON_POSITION_LEFT, 4); $this->searchContent = $dbList->getSearchBox(); } // Additional footer content $footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawFooterHook']; if (is_array($footerContentHook)) { foreach ($footerContentHook as $hook) { $params = array(); $content .= GeneralUtility::callUserFunction($hook, $params, $this); } } return $content; }
/** * Main * * @return string */ public function main() { $lang = $this->getLanguageService(); $POST = GeneralUtility::_POST(); $documentTemplate = $this->getDocumentTemplate(); // Checking for more than one template an if, set a menu... $manyTemplatesMenu = $this->pObj->templateMenu(); $template_uid = 0; if ($manyTemplatesMenu) { $template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage']; } $bType = $this->pObj->MOD_SETTINGS['ts_browser_type']; $existTemplate = $this->initialize_editor($this->pObj->id, $template_uid); $tplRow = $this->getTemplateRow(); // initialize $theOutput = ''; if ($existTemplate) { $content = ' ' . IconUtility::getSpriteIconForRecord('sys_template', $tplRow) . ' <strong>' . $this->pObj->linkWrapTemplateTitle($tplRow['title'], $bType == 'setup' ? 'config' : 'constants') . '</strong>' . htmlspecialchars(trim($tplRow['sitetitle']) ? ' (' . $tplRow['sitetitle'] . ')' : ''); $theOutput .= $this->pObj->doc->section($lang->getLL('currentTemplate'), $content); if ($manyTemplatesMenu) { $theOutput .= $this->pObj->doc->section('', $manyTemplatesMenu); } $theOutput .= $this->pObj->doc->spacer(10); if ($POST['add_property'] || $POST['update_value'] || $POST['clear_object']) { // add property $line = ''; if (is_array($POST['data'])) { $name = key($POST['data']); if ($POST['data'][$name]['name'] !== '') { // Workaround for this special case: User adds a key and submits by pressing the return key. The form however will use "add_property" which is the name of the first submit button in this form. unset($POST['update_value']); $POST['add_property'] = 'Add'; } if ($POST['add_property']) { $property = trim($POST['data'][$name]['name']); if (preg_replace('/[^a-zA-Z0-9_\\.]*/', '', $property) != $property) { $badPropertyMessage = GeneralUtility::makeInstance(FlashMessage::class, $lang->getLL('noSpaces') . '<br />' . $lang->getLL('nothingUpdated'), $lang->getLL('badProperty'), FlashMessage::ERROR); $this->addFlashMessage($badPropertyMessage); } else { $pline = $name . '.' . $property . ' = ' . trim($POST['data'][$name]['propertyValue']); $propertyAddedMessage = GeneralUtility::makeInstance(FlashMessage::class, htmlspecialchars($pline), $lang->getLL('propertyAdded')); $this->addFlashMessage($propertyAddedMessage); $line .= LF . $pline; } } elseif ($POST['update_value']) { $pline = $name . ' = ' . trim($POST['data'][$name]['value']); $updatedMessage = GeneralUtility::makeInstance(FlashMessage::class, htmlspecialchars($pline), $lang->getLL('valueUpdated')); $this->addFlashMessage($updatedMessage); $line .= LF . $pline; } elseif ($POST['clear_object']) { if ($POST['data'][$name]['clearValue']) { $pline = $name . ' >'; $objectClearedMessage = GeneralUtility::makeInstance(FlashMessage::class, htmlspecialchars($pline), $lang->getLL('objectCleared')); $this->addFlashMessage($objectClearedMessage); $line .= LF . $pline; } } } if ($line) { $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid']; // Set the data to be saved $recData = array(); $field = $bType == 'setup' ? 'config' : 'constants'; $recData['sys_template'][$saveId][$field] = $tplRow[$field] . $line; // Create new tce-object $tce = GeneralUtility::makeInstance(DataHandler::class); $tce->stripslashes_values = FALSE; // Initialize $tce->start($recData, array()); // Saved the stuff $tce->process_datamap(); // Clear the cache (note: currently only admin-users can clear the cache in tce_main.php) $tce->clear_cacheCmd('all'); // re-read the template ... $this->initialize_editor($this->pObj->id, $template_uid); } } } $tsbr = GeneralUtility::_GET('tsbr'); $templateService = $this->getExtendedTemplateService(); $update = 0; if (is_array($tsbr)) { // If any plus-signs were clicked, it's registred. $this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType] = $templateService->ext_depthKeys($tsbr, $this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType]); $update = 1; } if ($POST['Submit']) { // If any POST-vars are send, update the condition array $this->pObj->MOD_SETTINGS['tsbrowser_conditions'] = $POST['conditions']; $update = 1; } if ($update) { $this->getBackendUserAuthentication()->pushModuleData($this->pObj->MCONF['name'], $this->pObj->MOD_SETTINGS); } $templateService->matchAlternative = $this->pObj->MOD_SETTINGS['tsbrowser_conditions']; $templateService->matchAlternative[] = 'dummydummydummydummydummydummydummydummydummydummydummy'; // This is just here to make sure that at least one element is in the array so that the tsparser actually uses this array to match. $templateService->constantMode = $this->pObj->MOD_SETTINGS['ts_browser_const']; if ($this->pObj->sObj && $templateService->constantMode) { $templateService->constantMode = 'untouched'; } $templateService->regexMode = $this->pObj->MOD_SETTINGS['ts_browser_regexsearch']; $templateService->fixedLgd = $this->pObj->MOD_SETTINGS['ts_browser_fixedLgd']; $templateService->linkObjects = TRUE; $templateService->ext_regLinenumbers = TRUE; $templateService->ext_regComments = $this->pObj->MOD_SETTINGS['ts_browser_showComments']; $templateService->bType = $bType; if ($this->pObj->MOD_SETTINGS['ts_browser_type'] == 'const') { $templateService->ext_constants_BRP = (int) GeneralUtility::_GP('breakPointLN'); } else { $templateService->ext_config_BRP = (int) GeneralUtility::_GP('breakPointLN'); } $templateService->generateConfig(); if ($bType == 'setup') { $theSetup = $templateService->setup; } else { $theSetup = $templateService->setup_constants; } // EDIT A VALUE: if ($this->pObj->sObj) { list($theSetup, $theSetupValue) = $templateService->ext_getSetup($theSetup, $this->pObj->sObj ? $this->pObj->sObj : ''); if ($existTemplate) { // Value $out = ''; $out .= htmlspecialchars($this->pObj->sObj) . ' =<br />'; $out .= '<input type="text" name="data[' . htmlspecialchars($this->pObj->sObj) . '][value]" value="' . htmlspecialchars($theSetupValue) . '"' . $documentTemplate->formWidth(40) . ' />'; $out .= '<input class="btn btn-default" type="submit" name="update_value" value="' . $lang->getLL('updateButton') . '" />'; $theOutput .= $this->pObj->doc->section($lang->getLL('editProperty'), $out, 0, 0); // Property $out = '<span class="text-nowrap">' . htmlspecialchars($this->pObj->sObj) . '.'; $out .= '<input type="text" name="data[' . htmlspecialchars($this->pObj->sObj) . '][name]"' . $documentTemplate->formWidth(20) . ' /> = </span><br />'; $out .= '<input type="text" name="data[' . htmlspecialchars($this->pObj->sObj) . '][propertyValue]"' . $documentTemplate->formWidth(40) . ' />'; $out .= '<input class="btn btn-default" type="submit" name="add_property" value="' . $lang->getLL('addButton') . '" />'; $theOutput .= $this->pObj->doc->spacer(20); $theOutput .= $this->pObj->doc->section($lang->getLL('addProperty'), $out, 0, 0); // clear $out = htmlspecialchars($this->pObj->sObj) . ' <strong>' . $lang->csConvObj->conv_case($lang->charSet, $lang->getLL('clear'), 'toUpper') . '</strong> '; $out .= '<input type="checkbox" name="data[' . htmlspecialchars($this->pObj->sObj) . '][clearValue]" value="1" />'; $out .= '<input class="btn btn-default" type="submit" name="clear_object" value="' . $lang->getLL('clearButton') . '" />'; $theOutput .= $this->pObj->doc->spacer(20); $theOutput .= $this->pObj->doc->section($lang->getLL('clearObject'), $out, 0, 0); $theOutput .= $this->pObj->doc->spacer(10); } else { $noTemplateMessage = GeneralUtility::makeInstance(FlashMessage::class, $lang->getLL('noCurrentTemplate'), $lang->getLL('edit'), FlashMessage::ERROR); $this->addFlashMessage($noTemplateMessage); $theOutput .= htmlspecialchars($this->pObj->sObj) . ' = <strong>' . htmlspecialchars($theSetupValue) . '</strong>'; $theOutput .= $this->pObj->doc->spacer(10); } // Links: $out = ''; $urlParameters = array('id' => $this->pObj->id); $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters); if (!$this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][$this->pObj->sObj]) { if (!empty($theSetup)) { $out = '<a href="' . htmlspecialchars($aHref . '&addKey[' . rawurlencode($this->pObj->sObj) . ']=1&SET[ts_browser_toplevel_' . $bType . ']=' . rawurlencode($this->pObj->sObj)) . '">'; $out .= sprintf($lang->getLL('addKey'), htmlspecialchars($this->pObj->sObj)); } } else { $out = '<a href="' . htmlspecialchars($aHref . '&addKey[' . rawurlencode($this->pObj->sObj) . ']=0&SET[ts_browser_toplevel_' . $bType . ']=0') . '">'; $out .= sprintf($lang->getLL('removeKey'), htmlspecialchars($this->pObj->sObj)); } if ($out) { $theOutput .= $this->pObj->doc->divider(5); $theOutput .= $this->pObj->doc->section('', $out); } // back $out = $lang->getLL('back'); $out = '<a href="' . htmlspecialchars($aHref) . '"><strong>' . $out . '</strong></a>'; $theOutput .= $this->pObj->doc->divider(5); $theOutput .= $this->pObj->doc->section('', $out); } else { $templateService->tsbrowser_depthKeys = $this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType]; if (GeneralUtility::_POST('search') && GeneralUtility::_POST('search_field')) { // If any POST-vars are send, update the condition array $templateService->tsbrowser_depthKeys = $templateService->ext_getSearchKeys($theSetup, '', GeneralUtility::_POST('search_field'), array()); } $theOutput .= ' <div class="tsob-menu"> <div class="form-inline">'; if (is_array($this->pObj->MOD_MENU['ts_browser_type']) && count($this->pObj->MOD_MENU['ts_browser_type']) > 1) { $theOutput .= ' <div class="form-group"> <label class="control-label">' . $lang->getLL('browse') . '</label>' . BackendUtility::getFuncMenu($this->pObj->id, 'SET[ts_browser_type]', $bType, $this->pObj->MOD_MENU['ts_browser_type']) . ' </div>'; } if (is_array($this->pObj->MOD_MENU['ts_browser_toplevel_' . $bType]) && count($this->pObj->MOD_MENU['ts_browser_toplevel_' . $bType]) > 1) { $theOutput .= ' <div class="form-group"> <label class="control-label" for="ts_browser_toplevel_' . $bType . '">' . $lang->getLL('objectList') . '</label> ' . BackendUtility::getFuncMenu($this->pObj->id, 'SET[ts_browser_toplevel_' . $bType . ']', $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType], $this->pObj->MOD_MENU['ts_browser_toplevel_' . $bType]) . ' </div>'; } $theOutput .= ' <div class="form-group"> <label class="control-label" for="search_field">' . $lang->getLL('search') . '</label> <input class="form-control" type="search" name="search_field" id="search_field" value="' . htmlspecialchars($POST['search_field']) . '"' . $documentTemplate->formWidth(20) . '/> </div> <input class="btn btn-default tsob-search-submit" type="submit" name="search" value="' . $lang->sL('LLL:EXT:lang/locallang_common.xlf:search') . '" /> </div> <div class="checkbox"> <label for="checkTs_browser_regexsearch"> ' . BackendUtility::getFuncCheck($this->pObj->id, 'SET[ts_browser_regexsearch]', $this->pObj->MOD_SETTINGS['ts_browser_regexsearch'], '', '', 'id="checkTs_browser_regexsearch"') . $lang->getLL('regExp') . ' </label> </div> </div>'; $theKey = $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType]; if (!$theKey || !str_replace('-', '', $theKey)) { $theKey = ''; } list($theSetup, $theSetupValue) = $templateService->ext_getSetup($theSetup, $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType] ? $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType] : ''); $tree = $templateService->ext_getObjTree($theSetup, $theKey, '', '', $theSetupValue, $this->pObj->MOD_SETTINGS['ts_browser_alphaSort']); $tree = $templateService->substituteCMarkers($tree); $urlParameters = array('id' => $this->pObj->id); $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters); // Parser Errors: $pEkey = $bType == 'setup' ? 'config' : 'constants'; if (!empty($templateService->parserErrors[$pEkey])) { $errMsg = array(); foreach ($templateService->parserErrors[$pEkey] as $inf) { $errorLink = ' <a href="' . htmlspecialchars($aHref . '&SET[function]=TYPO3\\CMS\\Tstemplate\\Controller\\TemplateAnalyzerModuleFunctionController&template=all&SET[ts_analyzer_checkLinenum]=1#line-' . $inf[2]) . '">' . $lang->getLL('errorShowDetails') . '</a>'; $errMsg[] = $inf[1] . ': ' . $inf[0] . $errorLink; } $theOutput .= $this->pObj->doc->spacer(10); $title = $lang->getLL('errorsWarnings'); $message = '<p>' . implode($errMsg, '<br />') . '</p>'; $view = GeneralUtility::makeInstance(StandaloneView::class); $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:tstemplate/Resources/Private/Templates/InfoBox.html')); $view->assignMultiple(array('title' => $title, 'message' => $message, 'state' => InfoboxViewHelper::STATE_WARNING)); $theOutput .= $view->render(); } if (isset($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][$theKey])) { $remove = '<a href="' . htmlspecialchars($aHref . '&addKey[' . $theKey . ']=0&SET[ts_browser_toplevel_' . $bType . ']=0') . '">' . $lang->getLL('removeKey') . '</a>'; } else { $remove = ''; } $label = $theKey ? $theKey : ($bType == 'setup' ? $lang->csConvObj->conv_case($lang->charSet, $lang->getLL('setupRoot'), 'toUpper') : $lang->csConvObj->conv_case($lang->charSet, $lang->getLL('constantRoot'), 'toUpper')); $theOutput .= $this->pObj->doc->sectionEnd(); $theOutput .= '<div class="panel panel-space panel-default">'; $theOutput .= '<div class="panel-heading">'; $theOutput .= '<strong>' . $label . ' ' . $remove . '</strong>'; $theOutput .= '</div>'; $theOutput .= '<div class="panel-body">' . $tree . '</div>'; $theOutput .= '</div>'; // second row options $menu = '<div class="tsob-menu-row2">'; $menu .= '<div class="checkbox"><label for="checkTs_browser_showComments">' . BackendUtility::getFuncCheck($this->pObj->id, 'SET[ts_browser_showComments]', $this->pObj->MOD_SETTINGS['ts_browser_showComments'], '', '', 'id="checkTs_browser_showComments"'); $menu .= $lang->getLL('displayComments') . '</label></div>'; $menu .= '<div class="checkbox"><label for="checkTs_browser_alphaSort">' . BackendUtility::getFuncCheck($this->pObj->id, 'SET[ts_browser_alphaSort]', $this->pObj->MOD_SETTINGS['ts_browser_alphaSort'], '', '', 'id="checkTs_browser_alphaSort"'); $menu .= $lang->getLL('sortAlphabetically') . '</label></div>'; $menu .= '<div class="checkbox"><label for="checkTs_browser_fixedLgd">' . BackendUtility::getFuncCheck($this->pObj->id, 'SET[ts_browser_fixedLgd]', $this->pObj->MOD_SETTINGS['ts_browser_fixedLgd'], '', '', 'id="checkTs_browser_fixedLgd"'); $menu .= $lang->getLL('cropLines') . '</label></div>'; if ($bType == 'setup' && !$this->pObj->MOD_SETTINGS['ts_browser_fixedLgd']) { $menu .= '<br /><br /><label>' . $lang->getLL('displayConstants') . '</label>'; $menu .= BackendUtility::getFuncMenu($this->pObj->id, 'SET[ts_browser_const]', $this->pObj->MOD_SETTINGS['ts_browser_const'], $this->pObj->MOD_MENU['ts_browser_const']); } $menu .= '</div>'; $theOutput .= $this->pObj->doc->section($lang->getLL('displayOptions'), '<span class="text-nowrap">' . $menu . '</span>', 0, 1); // Conditions: if (is_array($templateService->sections) && !empty($templateService->sections)) { $theOutput .= $this->pObj->doc->section($lang->getLL('conditions'), '', 0, 1); $out = ''; foreach ($templateService->sections as $key => $val) { $out .= '<div class="checkbox"><label for="check' . $key . '">'; $out .= '<input class="checkbox" type="checkbox" name="conditions[' . $key . ']" id="check' . $key . '" value="' . htmlspecialchars($val) . '"' . ($this->pObj->MOD_SETTINGS['tsbrowser_conditions'][$key] ? ' checked' : '') . ' />' . $templateService->substituteCMarkers(htmlspecialchars($val)); $out .= '</label></div>'; } $theOutput .= '<div class="tsob-menu-row2">' . $out . '</div><input class="btn btn-default" type="submit" name="Submit" value="' . $lang->getLL('setConditions') . '" />'; } // Ending section: $theOutput .= $this->pObj->doc->sectionEnd(); } return $theOutput; }
/** * Main function of the module. Write the content to $this->content * If you chose "web" as main module, you will need to consider the $this->id parameter which will contain the uid-number of the page clicked in the page tree * @return [type] ... */ function main() { global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS; // Access check! // The page will show only if there is a valid page and if this page may be viewed by the user $this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; if ($this->id && $access || $BE_USER->user['admin'] && !$this->id) { $full_script_path = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'scripts/'; $this->relative_site_path = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop'); // first get the http-path to typo3: $this->httpTypo3Path = substr(substr(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'), strlen(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST'))), 0, -1); if (strlen($this->httpTypo3Path) == 1) { $this->httpTypo3Path = '/'; } else { $this->httpTypo3Path .= '/'; } // Get the vhost full path (example: /var/www/html/domain.com/public_html/my_cms/) $this->DOCUMENT_ROOT = PATH_site; // Get the vhost full path to multishop (example: /var/www/html/domain.com/public_html/my_cms/typo3conf/ext/multishop/) $this->DOCUMENT_ROOT_MS = PATH_site . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop'); // Get the site full URL (example: http://domain.com/my_cms/) $this->FULL_HTTP_URL = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL'); // Get the multishop full URL (example: http://domain.com/my_cms/typo3/ext/multishop or http://domain.com/my_cms/typo3conf/ext/multishop) $this->FULL_HTTP_URL_MS = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop'); // Get the host URL (example: http://domain.com) // dont use hostURL cause its not supporting subdirectory hosting $this->hostURL = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST'); // Draw the header. $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate'); //$this->doc->setModuleTemplate(ExtensionManagementUtility::extPath($this->extKey) . 'mod1/mod_template.html'); $this->doc->backPath = $GLOBALS['BACK_PATH']; //$this->doc= \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('bigDoc'); //$this->doc->backPath=$BACK_PATH; // JavaScript $this->doc->JScode = ' <style type="text/css"> /*<![CDATA[*/ <!-- /*inDocStyles*/ /*###POSTCSSMARKER###*/ --> /*]]>*/ .shadow_bottom { overflow:hidden; width:100%; background:url(' . $this->FULL_HTTP_URL_MS . 'mod1/images/shadow_bottom.png) left bottom no-repeat; padding:0 0 35px; } fieldset { display:block; border:1px solid #999; background:#fff; margin:10px 0 0; padding:10px 10px 10px; } fieldset legend { background:#585858; color:#fff; font-family:Verdana,Arial,Helvetica,sans-serif; font-size:11px; padding:2px 4px; } fieldset legend a { color:#fff; } fieldset legend a:hover { color:#fff; text-decoration:underline; } ul { list-style:none; margin:0; padding:0; } a.buttons, a.buttons_db { -moz-border-radius:1px 1px 1px 1px; BACKGROUND-IMAGE: url(' . $this->FULL_HTTP_URL . 'typo3/sysext/t3skin/images/backgrounds/button.png); background-color:#F6F6F6; background-image:-moz-linear-gradient(center top , #F6F6F6 10%, #D5D5D5 90%); background-position:center bottom; background-repeat:repeat-x; border:1px solid #7C7C7C; color:#434343; display:block; padding:2px 4px; text-align:center; font-family:Verdana,Arial,Helvetica,sans-serif; font-size:11px; line-height:16px; } a.buttons:hover, a.buttons_db:hover { BACKGROUND-IMAGE: url(' . $this->FULL_HTTP_URL . 'typo3/sysext/t3skin/images/backgrounds/button-hover.png); background-color:#C8C8C8; background-image:-moz-linear-gradient(center top , #F6F6F6 10%, #BDBCBC 90%); background-position:center bottom; background-repeat:repeat-x; border:1px solid #737F91; color:#1E1E1E; } a.buttons { width:142px; } a.buttons_db { width:126px; } fieldset.mod1MultishopFieldset ul { overflow:hidden; width:100%; } fieldset.mod1MultishopFieldset ul li { float:left; margin:0 10px 0 0; } </style> <!--[if IE]> <style> fieldset { position: relative; padding-top:15px; margin:20px 0 0; } legend { position: absolute; top: -10px; left: 10px; } </style> <![endif]--> <script language="javascript" type="text/javascript"> script_ended = 0; function jumpToUrl(URL) { document.location = URL; } function CONFIRM(label) { if (confirm(label)) { return true; } else { return false; } } </script> '; $this->doc->postCode = ' <script language="javascript" type="text/javascript"> script_ended = 1; if (top.fsMod) top.fsMod.recentIds["web"] = 0; </script> '; $headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($this->pageinfo['_thePath'], 50); $this->content .= $this->doc->startPage($LANG->getLL('title')); $this->content .= $this->doc->header($LANG->getLL('title')); $this->content .= $this->doc->spacer(5); $this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']))); $this->content .= $this->doc->divider(5); // Render content: $this->moduleContent(); // ShortCut if ($BE_USER->mayMakeShortcut()) { $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name'])); } $this->content .= $this->doc->spacer(10); } else { // If no access or if ID == zero $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('mediumDoc'); $this->doc->backPath = $BACK_PATH; $this->content .= $this->doc->startPage($LANG->getLL('title')); $this->content .= $this->doc->header($LANG->getLL('title')); $this->content .= $this->doc->spacer(5); $this->content .= $this->doc->spacer(10); } }
/** * Render template menu * * @return string */ public function templateMenu() { $this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class); $this->templateService->init(); $all = $this->templateService->ext_getAllTemplates($this->id); if (count($all) > 1) { $this->MOD_MENU['templatesOnPage'] = []; foreach ($all as $d) { $this->MOD_MENU['templatesOnPage'][$d['uid']] = $d['title']; } } $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList); return BackendUtility::getFuncMenu($this->id, 'SET[templatesOnPage]', $this->MOD_SETTINGS['templatesOnPage'], $this->MOD_MENU['templatesOnPage']); }
/** * Gets the function menu selector for this backend module. * * @return string The HTML representation of the function menu selector */ protected function getFunctionMenu() { $functionMenu = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']); return $functionMenu; }
/** * @todo Define visibility */ public function templateMenu() { // Defined global here! $tmpl = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\ExtendedTemplateService'); /** @var $tmpl \TYPO3\CMS\Core\TypoScript\ExtendedTemplateService */ // Do not log time-performance information $tmpl->tt_track = FALSE; $tmpl->init(); $all = $tmpl->ext_getAllTemplates($this->id, $this->perms_clause); $menu = ''; if (count($all) > 1) { $this->MOD_MENU['templatesOnPage'] = array(); foreach ($all as $d) { $this->MOD_MENU['templatesOnPage'][$d['uid']] = $d['title']; } } $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList); $menu = BackendUtility::getFuncMenu($this->id, 'SET[templatesOnPage]', $this->MOD_SETTINGS['templatesOnPage'], $this->MOD_MENU['templatesOnPage']); return $menu; }
/** * @param mixed $mainParams The "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=... * @param string $elementName The form elements name, probably something like "SET[...] * @param string $currentValue The value to be selected currently. * @param array $menuItems An array with the menu items for the selector box * @param string $script The script to send the &id to, if empty it's automatically found * @param string $addParams Additional parameters to pass to the script. * @return string HTML code for selector box */ public function getFuncMenu($mainParams, $elementName, $currentValue, $menuItems, $script = '', $addParams = '') { /** @noinspection PhpDeprecationInspection PhpUndefinedClassInspection */ return BackendUtility::getFuncMenu($mainParams, $elementName, $currentValue, $menuItems, $script, $addParams); }
/** * Showing the permissions in a tree ($this->edit = false) * (Adding content to internal content variable). * * @return void */ public function notEdit() { $backendUser = $this->getBackendUser(); $language = $this->getLanguageService(); // stores which depths already have their last item $depthStop = array(); $lastDepth = 0; // Get usernames and groupnames: The arrays we get in return contains only // 1) users which are members of the groups of the current user, // 2) groups that the current user is member of $beGroupKeys = $backendUser->userGroupsUID; $beUserArray = BackendUtility::getUserNames(); if (!$backendUser->isAdmin()) { $beUserArray = BackendUtility::blindUserNames($beUserArray, $beGroupKeys, 0); } $beGroupArray = BackendUtility::getGroupNames(); if (!$backendUser->isAdmin()) { $beGroupArray = BackendUtility::blindGroupNames($beGroupArray, $beGroupKeys, 0); } // Length of strings: $tLen = 20; // Selector for depth: $code = $language->getLL('Depth') . ': '; $code .= BackendUtility::getFuncMenu($this->categoryUid, 'SET[depth]', $this->MOD_SETTINGS['depth'], $this->MOD_MENU['depth']); $this->content .= $this->doc->section('', $code); // Initialize tree object: /** * Category tree. * * @var \CommerceTeam\Commerce\Tree\CategoryTree $tree */ $tree = GeneralUtility::makeInstance('CommerceTeam\\Commerce\\Tree\\CategoryTree'); $tree->setBare(); $tree->init(); $tree->readRecursively($this->categoryUid, $this->MOD_SETTINGS['depth']); // Creating top icon; the current page $rootIcon = IconUtility::getSpriteIcon('apps-pagetree-root'); // Create the tree from $this->categoryUid: $tree->getTree(); $tree = $tree->getRecordsAsArray($this->categoryUid); // Make header of table: $code = ' <thead> <tr> <th colspan="2"> </th> <th>' . $language->getLL('Owner', true) . '</th> <th align="center">' . $language->getLL('Group', true) . '</th> <th align="center">' . $language->getLL('Everybody', true) . '</th> <th align="center">' . $language->getLL('EditLock', true) . '</th> </tr> </thead> '; // Traverse tree: foreach ($tree as $data) { $cells = array(); $pageId = $data['row']['uid']; // Background colors: $bgCol = $this->lastEdited == $pageId ? ' class="bgColor-20"' : ''; // User/Group names: $userId = $data['row']['perms_userid']; $userName = $beUserArray[$userId] ? $beUserArray[$userId]['username'] : $userId; if ($userId && !$beUserArray[$userId]) { $userName = PermissionAjaxController::renderOwnername($pageId, $userId, htmlspecialchars(GeneralUtility::fixed_lgd_cs($userName, 20)), false); } else { $userName = PermissionAjaxController::renderOwnername($pageId, $userId, htmlspecialchars(GeneralUtility::fixed_lgd_cs($userName, 20))); } $groupId = $data['row']['perms_groupid'] ? $data['row']['perms_groupid'] : ''; $groupName = $beGroupArray[$groupId] ? $beGroupArray[$groupId]['title'] : $groupId; if ($groupId && !$beGroupArray[$groupId]) { $groupName = PermissionAjaxController::renderGroupname($pageId, $groupId, htmlspecialchars(GeneralUtility::fixed_lgd_cs($groupName, 20)), false); } else { $groupName = PermissionAjaxController::renderGroupname($pageId, $groupId, htmlspecialchars(GeneralUtility::fixed_lgd_cs($groupName, 20))); } // Seeing if editing of permissions are allowed for that page: $editPermsAllowed = $userId == $backendUser->user['uid'] || $backendUser->isAdmin(); // First column: // @todo check for better solution $plusMinusIcon = ''; // Add PM only if we are not looking at the root if ($data['depth'] > 0) { // Add simple join-images for categories that are deeper level than 1 if ($data['depth'] > 1) { $k = $data['depth']; for ($j = 1; $j < $k; ++$j) { if (!array_key_exists($j, $depthStop) || $depthStop[$j] != 1) { $plusMinusIcon .= IconUtility::getSpriteIcon('treeline-line'); } elseif ($depthStop[$j] == 1) { $plusMinusIcon .= IconUtility::getSpriteIcon('treeline-blank'); } } } if ($lastDepth > $data['depth']) { for ($j = $data['depth'] + 1; $j <= $lastDepth; ++$j) { $depthStop[$j] = 0; } } // Add cross or bottom $bottom = true == $data['last'] ? 'bottom' : ''; // save that the depth of the current record has its last item - is used to // add blanks, not lines to following deeper elements if (true == $data['last']) { $depthStop[$data['depth']] = 1; } $lastDepth = $data['depth']; $plusMinusIcon .= IconUtility::getSpriteIcon('treeline-join' . $bottom); } // determine which icon to use $rowIcon = $plusMinusIcon . ($pageId ? IconUtility::getSpriteIconForRecord('tx_commerce_categories', $data['row']) : $rootIcon); // @todo end of check for better solution // First column: $cellAttrib = $data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : ''; $cells[] = '<td align="left" nowrap="nowrap"' . ($cellAttrib ? $cellAttrib : $bgCol) . '>' . $rowIcon . htmlspecialchars(GeneralUtility::fixed_lgd_cs($data['row']['title'], $tLen)) . '</td>'; // "Edit permissions" -icon if ($editPermsAllowed && $pageId) { $aHref = BackendUtility::getModuleUrl('commerce_permission') . '&mode=' . $this->MOD_SETTINGS['mode'] . '&depth=' . $this->MOD_SETTINGS['depth'] . '&control[tx_commerce_categories][uid]=' . ($data['row']['_ORIG_uid'] ? $data['row']['_ORIG_uid'] : $pageId) . '&return_id=' . $this->id . '&edit=1'; $cells[] = '<td' . $bgCol . '><a href="' . htmlspecialchars($aHref) . '" title="' . $language->getLL('ch_permissions', 1) . '">' . IconUtility::getSpriteIcon('actions-document-open') . '</a></td>'; } else { $cells[] = LF . '<td' . $bgCol . '></td>'; } $userPermission = PermissionAjaxController::renderPermissions($data['row']['perms_user'], $pageId, 'user'); $groupPermission = PermissionAjaxController::renderPermissions($data['row']['perms_group'], $pageId, 'group'); $allPermission = PermissionAjaxController::renderPermissions($data['row']['perms_everybody'], $pageId, 'everybody'); $userPermissionLabel = $pageId ? $userPermission . ' ' . $userName : ''; $groupPermissionLabel = $pageId ? $groupPermission . ' ' . $groupName : ''; $allPermissionLabel = $pageId ? ' ' . $allPermission : ''; if ($data['row']['editlock']) { $editLockLabel = '<span id="el_' . $pageId . '" class="editlock"><a class="editlock" onclick="WebPermissions.toggleEditLock(\'' . $pageId . '\', \'1\');" title="' . $language->getLL('EditLock_descr', true) . '">' . IconUtility::getSpriteIcon('status-warning-lock') . '</a></span>'; } else { $editLockLabel = $pageId === 0 ? '' : '<span id="el_' . $pageId . '" class="editlock"><a class="editlock" onclick="WebPermissions.toggleEditLock(\'' . $pageId . '\', \'0\');" title="Enable the »Admin-only« edit lock for this page">[+]</a></span>'; } $cells[] = ' <td' . $bgCol . ' nowrap="nowrap">' . $userPermissionLabel . '</td> <td' . $bgCol . ' nowrap="nowrap">' . $groupPermissionLabel . '</td> <td' . $bgCol . ' nowrap="nowrap">' . $allPermissionLabel . '</td> <td' . $bgCol . ' nowrap="nowrap">' . $editLockLabel . '</td> '; // Compile table row: $code .= '<tr>' . implode(LF, $cells) . '</tr>'; } // Wrap rows in table tags: $code = '<table class="t3-table" id="typo3-permissionList">' . $code . '</table>'; // Adding the content as a section: $this->content .= $this->doc->section('', $code); // CSH for permissions setting $this->content .= BackendUtility::cshItem('xMOD_csh_corebe', 'perm_module', $this->getBackPath(), '<br />|'); // Creating legend table: $legendText = '<strong>' . $language->getLL('1', true) . '</strong>: ' . $language->getLL('1_t', true) . '<br /><strong>' . $language->getLL('16', true) . '</strong>: ' . $language->getLL('16_t', true) . '<br /><strong>' . $language->getLL('2', true) . '</strong>: ' . $language->getLL('2_t', true) . '<br /><strong>' . $language->getLL('4', true) . '</strong>: ' . $language->getLL('4_t', true) . '<br /><strong>' . $language->getLL('8', true) . '</strong>: ' . $language->getLL('8_t', true); $code = '<div id="permission-information"> <img' . IconUtility::skinImg($this->getBackPath(), 'gfx/legend.gif', 'width="86" height="75"') . ' alt="" /> <div class="text">' . $legendText . '</div></div>'; $code .= '<div id="perm-legend">' . $language->getLL('def', true); $code .= '<br /><br />' . IconUtility::getSpriteIcon('status-status-permission-granted') . ': ' . $language->getLL('A_Granted', true); $code .= '<br />' . IconUtility::getSpriteIcon('status-status-permission-denied') . ': ' . $language->getLL('A_Denied', true) . '</div>'; // Adding section with legend code: $this->content .= $this->doc->section($language->getLL('Legend') . ':', $code, true, true); }
/** * Main function of the module. Write the content to $this->content * * @return void */ public function main() { // Template markers $markers = array('CSH' => '', 'FUNC_MENU' => '', 'WS_MENU' => '', 'CONTENT' => ''); // Setting module configuration: $this->MCONF['name'] = $this->moduleName; $this->REQUEST_URI = str_replace('&sendToReview=1', '', GeneralUtility::getIndpEnv('REQUEST_URI')); // Draw the header. $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class); $this->doc->setModuleTemplate('EXT:version/Resources/Private/Templates/version.html'); // Setting up the context sensitive menu: $this->doc->getContextMenuCode(); // Getting input data: $this->id = (int) GeneralUtility::_GP('id'); // Record uid. Goes with table name to indicate specific record $this->uid = (int) GeneralUtility::_GP('uid'); // // Record table. Goes with uid to indicate specific record $this->table = GeneralUtility::_GP('table'); $this->details = GeneralUtility::_GP('details'); // Page id. If set, indicates activation from Web>Versioning module $this->diffOnly = GeneralUtility::_GP('diffOnly'); // Flag. If set, shows only the offline version and with diff-view // Force this setting: $this->MOD_SETTINGS['expandSubElements'] = true; $this->MOD_SETTINGS['diff'] = $this->details || $this->MOD_SETTINGS['diff'] ? 1 : 0; // Reading the record: $record = BackendUtility::getRecord($this->table, $this->uid); if ($record['pid'] == -1) { $record = BackendUtility::getRecord($this->table, $record['t3ver_oid']); } $this->recordFound = is_array($record); $pidValue = $this->table === 'pages' ? $this->uid : $record['pid']; // Checking access etc. if ($this->recordFound && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS'] && !$this->id) { $this->uid = $record['uid']; // Might have changed if new live record was found! // Access check! // The page will show only if there is a valid page and if this page may be viewed by the user $this->pageinfo = BackendUtility::readPageAccess($pidValue, $this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; if ($pidValue && $access || $GLOBALS['BE_USER']->user['admin'] && !$pidValue) { // If another page module was specified, replace the default Page module with the new one $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule')); $this->pageModule = BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout'; // Setting publish access permission for workspace: $this->publishAccess = $GLOBALS['BE_USER']->workspacePublishAccess($GLOBALS['BE_USER']->workspace); $this->versioningMgm(); } // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CSH'] = $docHeaderButtons['csh']; $markers['FUNC_MENU'] = BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']); $markers['CONTENT'] = $this->content; } else { // If no access or id value, create empty document $this->content = '<h2>' . $GLOBALS['LANG']->getLL('clickAPage_header', true) . '</h2><div>' . $GLOBALS['LANG']->getLL('clickAPage_content') . '</div>'; // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CONTENT'] = $this->content; } // Build the <body> for the module $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('title')); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Main function, creating the listing * * @return void */ public function main() { // Initialize the template object $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->setModuleTemplate('EXT:filelist/Resources/Private/Templates/file_list.html'); /** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */ $pageRenderer = $this->doc->getPageRenderer(); $pageRenderer->loadJQuery(); $pageRenderer->loadRequireJsModule('TYPO3/CMS/Filelist/FileListLocalisation'); // There there was access to this file path, continue, make the list if ($this->folderObject) { // Create filelisting object $this->filelist = GeneralUtility::makeInstance(FileList::class); $this->filelist->backPath = $GLOBALS['BACK_PATH']; // Apply predefined values for hidden checkboxes // Set predefined value for DisplayBigControlPanel: $backendUser = $this->getBackendUser(); if ($backendUser->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'activated') { $this->MOD_SETTINGS['bigControlPanel'] = TRUE; } elseif ($backendUser->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'deactivated') { $this->MOD_SETTINGS['bigControlPanel'] = FALSE; } // Set predefined value for DisplayThumbnails: if ($backendUser->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'activated') { $this->MOD_SETTINGS['displayThumbs'] = TRUE; } elseif ($backendUser->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'deactivated') { $this->MOD_SETTINGS['displayThumbs'] = FALSE; } // Set predefined value for Clipboard: if ($backendUser->getTSConfigVal('options.file_list.enableClipBoard') === 'activated') { $this->MOD_SETTINGS['clipBoard'] = TRUE; } elseif ($backendUser->getTSConfigVal('options.file_list.enableClipBoard') === 'deactivated') { $this->MOD_SETTINGS['clipBoard'] = FALSE; } // If user never opened the list module, set the value for displayThumbs if (!isset($this->MOD_SETTINGS['displayThumbs'])) { $this->MOD_SETTINGS['displayThumbs'] = $backendUser->uc['thumbnailsByDefault']; } $this->filelist->thumbs = $this->MOD_SETTINGS['displayThumbs']; // Create clipboard object and initialize that $this->filelist->clipObj = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Clipboard\Clipboard::class); $this->filelist->clipObj->fileMode = 1; $this->filelist->clipObj->initializeClipboard(); $CB = GeneralUtility::_GET('CB'); if ($this->cmd == 'setCB') { $CB['el'] = $this->filelist->clipObj->cleanUpCBC(array_merge(GeneralUtility::_POST('CBH'), (array) GeneralUtility::_POST('CBC')), '_FILE'); } if (!$this->MOD_SETTINGS['clipBoard']) { $CB['setP'] = 'normal'; } $this->filelist->clipObj->setCmd($CB); $this->filelist->clipObj->cleanCurrent(); // Saves $this->filelist->clipObj->endClipboard(); // If the "cmd" was to delete files from the list (clipboard thing), do that: if ($this->cmd == 'delete') { $items = $this->filelist->clipObj->cleanUpCBC(GeneralUtility::_POST('CBC'), '_FILE', 1); if (!empty($items)) { // Make command array: $FILE = array(); foreach ($items as $v) { $FILE['delete'][] = array('data' => $v); } // Init file processing object for deleting and pass the cmd array. $fileProcessor = GeneralUtility::makeInstance(ExtendedFileUtility::class); $fileProcessor->init(array(), $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']); $fileProcessor->setActionPermissions(); $fileProcessor->dontCheckForUnique = $this->overwriteExistingFiles ? 1 : 0; $fileProcessor->start($FILE); $fileProcessor->processData(); $fileProcessor->pushErrorMessagesToFlashMessageQueue(); } } if (!isset($this->MOD_SETTINGS['sort'])) { // Set default sorting $this->MOD_SETTINGS['sort'] = 'file'; $this->MOD_SETTINGS['reverse'] = 0; } // Start up filelisting object, include settings. $this->pointer = MathUtility::forceIntegerInRange($this->pointer, 0, 100000); $this->filelist->start($this->folderObject, $this->pointer, $this->MOD_SETTINGS['sort'], $this->MOD_SETTINGS['reverse'], $this->MOD_SETTINGS['clipBoard'], $this->MOD_SETTINGS['bigControlPanel']); // Generate the list $this->filelist->generateList(); // Set top JavaScript: $this->doc->JScode = $this->doc->wrapScriptTags('if (top.fsMod) top.fsMod.recentIds["file"] = "' . rawurlencode($this->id) . '";' . $this->filelist->CBfunctions()); // This will return content necessary for the context sensitive clickmenus to work: bodytag events, JavaScript functions and DIV-layers. $this->doc->getContextMenuCode(); // Setting up the buttons and markers for docheader list($buttons, $otherMarkers) = $this->filelist->getButtonsAndOtherMarkers($this->folderObject); // add the folder info to the marker array $otherMarkers['FOLDER_INFO'] = $this->filelist->getFolderInfo(); $docHeaderButtons = array_merge($this->getButtons(), $buttons); // Include DragUploader only if we have write access if ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File') && $this->folderObject->checkActionPermission('write')) { $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DragUploader'); $pageRenderer->addInlineLanguagelabelFile(ExtensionManagementUtility::extPath('lang') . 'locallang_core.xlf', 'file_upload'); } // Build the <body> for the module $moduleHeadline = $this->getModuleHeadline(); // Create output $pageContent = $moduleHeadline !== '' ? '<h1>' . $moduleHeadline . '</h1>' : ''; $pageContent .= '<form action="' . htmlspecialchars($this->filelist->listURL()) . '" method="post" name="dblistForm">'; $pageContent .= $this->filelist->HTMLcode; $pageContent .= '<input type="hidden" name="cmd" /></form>'; // Making listing options: if ($this->filelist->HTMLcode) { $pageContent .= ' <!-- Listing options for extended view, clipboard and thumbnails --> <div id="typo3-listOptions"> '; // Add "display bigControlPanel" checkbox: if ($backendUser->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'selectable') { $pageContent .= '<div class="checkbox">' . '<label for="bigControlPanel">' . BackendUtility::getFuncCheck($this->id, 'SET[bigControlPanel]', $this->MOD_SETTINGS['bigControlPanel'], '', '', 'id="bigControlPanel"') . $this->getLanguageService()->getLL('bigControlPanel', TRUE) . '</label>' . '</div>'; } // Add "display thumbnails" checkbox: if ($backendUser->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'selectable') { $pageContent .= '<div class="checkbox">' . '<label for="checkDisplayThumbs">' . BackendUtility::getFuncCheck($this->id, 'SET[displayThumbs]', $this->MOD_SETTINGS['displayThumbs'], '', '', 'id="checkDisplayThumbs"') . $this->getLanguageService()->getLL('displayThumbs', TRUE) . '</label>' . '</div>'; } // Add "clipboard" checkbox: if ($backendUser->getTSConfigVal('options.file_list.enableClipBoard') === 'selectable') { $pageContent .= '<div class="checkbox">' . '<label for="checkClipBoard">' . BackendUtility::getFuncCheck($this->id, 'SET[clipBoard]', $this->MOD_SETTINGS['clipBoard'], '', '', 'id="checkClipBoard"') . $this->getLanguageService()->getLL('clipBoard', TRUE) . '</label>' . '</div>'; } $pageContent .= ' </div> '; // Set clipboard: if ($this->MOD_SETTINGS['clipBoard']) { $pageContent .= $this->filelist->clipObj->printClipboard(); $pageContent .= BackendUtility::cshItem('xMOD_csh_corebe', 'filelist_clipboard'); } } $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => ($this->errorMessage ? $this->errorMessage->render() : '') . $pageContent, 'FOLDER_IDENTIFIER' => $this->folderObject->getCombinedIdentifier(), 'FILEDENYPATERN' => $GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'], 'MAXFILESIZE' => GeneralUtility::getMaxUploadFileSize() * 1024); $this->content = $this->doc->moduleBody(array(), $docHeaderButtons, array_merge($markerArray, $otherMarkers)); // Renders the module page $this->content = $this->doc->render($this->getLanguageService()->getLL('files'), $this->content); } else { $content = ''; if ($this->errorMessage) { $this->errorMessage->setSeverity(FlashMessage::ERROR); $content = $this->doc->moduleBody(array(), array_merge(array('REFRESH' => '', 'PASTE' => '', 'LEVEL_UP' => ''), $this->getButtons()), array('CSH' => '', 'TITLE' => '', 'FOLDER_INFO' => '', 'PAGE_ICON' => '', 'FUNC_MENU' => '', 'CONTENT' => $this->errorMessage->render())); } // Create output - no access (no warning though) $this->content = $this->doc->render($this->getLanguageService()->getLL('files'), $content); } }
/** * Main function of the module. Write the content to $this->content. * * @return void */ public function main() { $backendUser = $this->getBackendUser(); $language = $this->getLanguageService(); // Access check! // The page will show only if there is a valid page and if // this page may be viewed by the user $this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause); $access = is_array($this->pageinfo); // Checking access: if ($this->id && $access || $backendUser->isAdmin()) { // Render content: $this->moduleContent(); } else { // If no access or if ID == zero $this->content .= $this->doc->header($language->getLL('statistic')); } $docHeaderButtons = $this->getHeaderButtons(); $markers = array('CSH' => $docHeaderButtons['csh'], 'CONTENT' => $this->content); $markers['FUNC_MENU'] = $this->doc->funcMenu('', \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])); // put it all together $this->content = $this->doc->startPage($language->getLL('statistic')); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Creates depth selector HTML for the page tree. * * @return string */ protected function getDepthSelector() { return $GLOBALS['LANG']->getLL('depth') . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth']); }
/** * Main * * @return string * @todo Define visibility */ public function main() { global $BACK_PATH; global $tmpl, $tplRow, $theConstants; $POST = GeneralUtility::_POST(); // Checking for more than one template an if, set a menu... $manyTemplatesMenu = $this->pObj->templateMenu(); $template_uid = 0; if ($manyTemplatesMenu) { $template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage']; } // BUGBUG: Should we check if the user may at all read and write template-records??? $bType = $this->pObj->MOD_SETTINGS['ts_browser_type']; $existTemplate = $this->initialize_editor($this->pObj->id, $template_uid); // initialize if ($existTemplate) { $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('currentTemplate'), ' <img ' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], \TYPO3\CMS\Backend\Utility\IconUtility::getIcon('sys_template', $tplRow)) . ' align="top" /> <strong>' . $this->pObj->linkWrapTemplateTitle($tplRow['title'], $bType == 'setup' ? 'config' : 'constants') . '</strong>' . htmlspecialchars(trim($tplRow['sitetitle']) ? ' (' . $tplRow['sitetitle'] . ')' : '')); if ($manyTemplatesMenu) { $theOutput .= $this->pObj->doc->section('', $manyTemplatesMenu); } $theOutput .= $this->pObj->doc->spacer(10); if ($POST['add_property'] || $POST['update_value'] || $POST['clear_object']) { // add property $line = ''; if (is_array($POST['data'])) { $name = key($POST['data']); if ($POST['data'][$name]['name'] !== '') { // Workaround for this special case: User adds a key and submits by pressing the return key. The form however will use "add_property" which is the name of the first submit button in this form. unset($POST['update_value']); $POST['add_property'] = 'Add'; } if ($POST['add_property']) { $property = trim($POST['data'][$name]['name']); if (preg_replace('/[^a-zA-Z0-9_\\.]*/', '', $property) != $property) { $badPropertyMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('noSpaces') . '<br />' . $GLOBALS['LANG']->getLL('nothingUpdated'), $GLOBALS['LANG']->getLL('badProperty'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR); $this->addFlashMessage($badPropertyMessage); } else { $pline = $name . '.' . $property . ' = ' . trim($POST['data'][$name]['propertyValue']); $propertyAddedMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('propertyAdded')); $this->addFlashMessage($propertyAddedMessage); $line .= LF . $pline; } } elseif ($POST['update_value']) { $pline = $name . ' = ' . trim($POST['data'][$name]['value']); $updatedMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('valueUpdated')); $this->addFlashMessage($updatedMessage); $line .= LF . $pline; } elseif ($POST['clear_object']) { if ($POST['data'][$name]['clearValue']) { $pline = $name . ' >'; $objectClearedMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('objectCleared')); $this->addFlashMessage($objectClearedMessage); $line .= LF . $pline; } } } if ($line) { $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid']; // Set the data to be saved $recData = array(); $field = $bType == 'setup' ? 'config' : 'constants'; $recData['sys_template'][$saveId][$field] = $tplRow[$field] . $line; // Create new tce-object $tce = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler'); $tce->stripslashes_values = 0; // Initialize $tce->start($recData, array()); // Saved the stuff $tce->process_datamap(); // Clear the cache (note: currently only admin-users can clear the cache in tce_main.php) $tce->clear_cacheCmd('all'); // re-read the template ... $this->initialize_editor($this->pObj->id, $template_uid); } } } $tsbr = GeneralUtility::_GET('tsbr'); $update = 0; if (is_array($tsbr)) { // If any plus-signs were clicked, it's registred. $this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType] = $tmpl->ext_depthKeys($tsbr, $this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType]); $update = 1; } if ($POST['Submit']) { // If any POST-vars are send, update the condition array $this->pObj->MOD_SETTINGS['tsbrowser_conditions'] = $POST['conditions']; $update = 1; } if ($update) { $GLOBALS['BE_USER']->pushModuleData($this->pObj->MCONF['name'], $this->pObj->MOD_SETTINGS); } $tmpl->matchAlternative = $this->pObj->MOD_SETTINGS['tsbrowser_conditions']; $tmpl->matchAlternative[] = 'dummydummydummydummydummydummydummydummydummydummydummy'; // This is just here to make sure that at least one element is in the array so that the tsparser actually uses this array to match. $tmpl->constantMode = $this->pObj->MOD_SETTINGS['ts_browser_const']; if ($this->pObj->sObj && $tmpl->constantMode) { $tmpl->constantMode = 'untouched'; } $tmpl->regexMode = $this->pObj->MOD_SETTINGS['ts_browser_regexsearch']; $tmpl->fixedLgd = $this->pObj->MOD_SETTINGS['ts_browser_fixedLgd']; $tmpl->linkObjects = TRUE; $tmpl->ext_regLinenumbers = TRUE; $tmpl->ext_regComments = $this->pObj->MOD_SETTINGS['ts_browser_showComments']; $tmpl->bType = $bType; $tmpl->resourceCheck = 1; $tmpl->removeFromGetFilePath = PATH_site; if ($this->pObj->MOD_SETTINGS['ts_browser_type'] == 'const') { $tmpl->ext_constants_BRP = (int) GeneralUtility::_GP('breakPointLN'); } else { $tmpl->ext_config_BRP = (int) GeneralUtility::_GP('breakPointLN'); } $tmpl->generateConfig(); if ($bType == 'setup') { $theSetup = $tmpl->setup; } else { $theSetup = $tmpl->setup_constants; } // EDIT A VALUE: if ($this->pObj->sObj) { list($theSetup, $theSetupValue) = $tmpl->ext_getSetup($theSetup, $this->pObj->sObj ? $this->pObj->sObj : ''); if ($existTemplate) { // Value $out = ''; $out .= htmlspecialchars($this->pObj->sObj) . ' =<br />'; $out .= '<input type="Text" name="data[' . htmlspecialchars($this->pObj->sObj) . '][value]" value="' . htmlspecialchars($theSetupValue) . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(40) . ' />'; $out .= '<input type="Submit" name="update_value" value="' . $GLOBALS['LANG']->getLL('updateButton') . '" />'; $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('editProperty'), $out, 0, 0); // Property $out = ''; $out = '<nobr>' . htmlspecialchars($this->pObj->sObj) . '.'; $out .= '<input type="Text" name="data[' . htmlspecialchars($this->pObj->sObj) . '][name]"' . $GLOBALS['TBE_TEMPLATE']->formWidth(20) . ' /> = </nobr><br />'; $out .= '<input type="Text" name="data[' . htmlspecialchars($this->pObj->sObj) . '][propertyValue]"' . $GLOBALS['TBE_TEMPLATE']->formWidth(40) . ' />'; $out .= '<input type="Submit" name="add_property" value="' . $GLOBALS['LANG']->getLL('addButton') . '" />'; $theOutput .= $this->pObj->doc->spacer(20); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('addProperty'), $out, 0, 0); // clear $out = ''; $out = htmlspecialchars($this->pObj->sObj) . ' <strong>' . $GLOBALS['LANG']->csConvObj->conv_case($GLOBALS['LANG']->charSet, $GLOBALS['LANG']->getLL('clear'), 'toUpper') . '</strong> '; $out .= '<input type="Checkbox" name="data[' . htmlspecialchars($this->pObj->sObj) . '][clearValue]" value="1" />'; $out .= '<input type="Submit" name="clear_object" value="' . $GLOBALS['LANG']->getLL('clearButton') . '" />'; $theOutput .= $this->pObj->doc->spacer(20); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('clearObject'), $out, 0, 0); $theOutput .= $this->pObj->doc->spacer(10); } else { $noTemplateMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('noCurrentTemplate'), $GLOBALS['LANG']->getLL('edit'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR); $this->addFlashMessage($noTemplateMessage); $theOutput .= htmlspecialchars($this->pObj->sObj) . ' = <strong>' . htmlspecialchars($theSetupValue) . '</strong>'; $theOutput .= $this->pObj->doc->spacer(10); } // Links: $out = ''; $urlParameters = array('id' => $this->pObj->id); $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters); if (!$this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][$this->pObj->sObj]) { if (count($theSetup)) { $out = '<a href="' . htmlspecialchars($aHref . '&addKey[' . rawurlencode($this->pObj->sObj) . ']=1&SET[ts_browser_toplevel_' . $bType . ']=' . rawurlencode($this->pObj->sObj)) . '">'; $out .= sprintf($GLOBALS['LANG']->getLL('addKey'), htmlspecialchars($this->pObj->sObj)); } } else { $out = '<a href="' . htmlspecialchars($aHref . '&addKey[' . rawurlencode($this->pObj->sObj) . ']=0&SET[ts_browser_toplevel_' . $bType . ']=0') . '">'; $out .= sprintf($GLOBALS['LANG']->getLL('removeKey'), htmlspecialchars($this->pObj->sObj)); } if ($out) { $theOutput .= $this->pObj->doc->divider(5); $theOutput .= $this->pObj->doc->section('', $out); } // back $out = $GLOBALS['LANG']->getLL('back'); $out = '<a href="' . htmlspecialchars($aHref) . '"><strong>' . $out . '</strong></a>'; $theOutput .= $this->pObj->doc->divider(5); $theOutput .= $this->pObj->doc->section('', $out); } else { $tmpl->tsbrowser_depthKeys = $this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType]; if (GeneralUtility::_POST('search') && GeneralUtility::_POST('search_field')) { // If any POST-vars are send, update the condition array $tmpl->tsbrowser_depthKeys = $tmpl->ext_getSearchKeys($theSetup, '', GeneralUtility::_POST('search_field'), array()); } $menu = '<div class="tsob-menu"><label>' . $GLOBALS['LANG']->getLL('browse') . '</label>'; $menu .= BackendUtility::getFuncMenu($this->pObj->id, 'SET[ts_browser_type]', $bType, $this->pObj->MOD_MENU['ts_browser_type']); $menu .= '<label for="ts_browser_toplevel_' . $bType . '">' . $GLOBALS['LANG']->getLL('objectList') . '</label>'; $menu .= BackendUtility::getFuncMenu($this->pObj->id, 'SET[ts_browser_toplevel_' . $bType . ']', $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType], $this->pObj->MOD_MENU['ts_browser_toplevel_' . $bType]); //search $menu .= '<label for="search_field">' . $GLOBALS['LANG']->getLL('search') . '</label>'; $menu .= '<input type="Text" name="search_field" id="search_field" value="' . htmlspecialchars($POST['search_field']) . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(20) . '/>'; $menu .= '<input type="Submit" name="search" class="tsob-search-submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:search') . '" />'; $menu .= BackendUtility::getFuncCheck($this->pObj->id, 'SET[ts_browser_regexsearch]', $this->pObj->MOD_SETTINGS['ts_browser_regexsearch'], '', '', 'id="checkTs_browser_regexsearch"'); $menu .= '<label for="checkTs_browser_regexsearch">' . $GLOBALS['LANG']->getLL('regExp') . '</label>'; $menu .= '</div>'; $theOutput .= $this->pObj->doc->section('', '<nobr>' . $menu . '</nobr>'); $theKey = $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType]; if (!$theKey || !str_replace('-', '', $theKey)) { $theKey = ''; } list($theSetup, $theSetupValue) = $tmpl->ext_getSetup($theSetup, $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType] ? $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType] : ''); $tree = $tmpl->ext_getObjTree($theSetup, $theKey, '', '', $theSetupValue, $this->pObj->MOD_SETTINGS['ts_browser_alphaSort']); $tree = $tmpl->substituteCMarkers($tree); $urlParameters = array('id' => $this->pObj->id); $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters); // Parser Errors: $pEkey = $bType == 'setup' ? 'config' : 'constants'; if (count($tmpl->parserErrors[$pEkey])) { $errMsg = array(); $templateAnalyzerInstalled = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('tstemplate'); foreach ($tmpl->parserErrors[$pEkey] as $inf) { $errorLink = ''; if ($templateAnalyzerInstalled) { $errorLink = ' <a href="' . htmlspecialchars($aHref . '&SET[function]=TYPO3\\CMS\\Tstemplate\\Controller\\TemplateAnalyzerModuleFunctionController&template=all&SET[ts_analyzer_checkLinenum]=1#line-' . $inf[2]) . '">' . $GLOBALS['LANG']->getLL('errorShowDetails') . '</a>'; } $errMsg[] = $inf[1] . ': ' . $inf[0] . $errorLink; } $theOutput .= $this->pObj->doc->spacer(10); $flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', implode($errMsg, '<br />'), $GLOBALS['LANG']->getLL('errorsWarnings'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR); $theOutput .= $flashMessage->render(); } if (isset($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][$theKey])) { $remove = '<th><a href="' . htmlspecialchars($aHref . '&addKey[' . $theKey . ']=0&SET[ts_browser_toplevel_' . $bType . ']=0') . '">' . $GLOBALS['LANG']->getLL('removeKey') . '</a></th>'; } else { $remove = ''; } $label = $theKey ? $theKey : ($bType == 'setup' ? $GLOBALS['LANG']->csConvObj->conv_case($GLOBALS['LANG']->charSet, $GLOBALS['LANG']->getLL('setupRoot'), 'toUpper') : $GLOBALS['LANG']->csConvObj->conv_case($GLOBALS['LANG']->charSet, $GLOBALS['LANG']->getLL('constantRoot'), 'toUpper')); $theOutput .= $this->pObj->doc->spacer(15); $theOutput .= $this->pObj->doc->sectionEnd(); $theOutput .= '<table class="t3-table" id="typo3-objectBrowser"> <thead> <tr> <th>' . $label . '</th>' . $remove . '</tr> </thead> <tbody> <tr> <td>' . $tree . '</td>' . ($remove ? '<td></td>' : '') . ' </tr> </tbody> </table>'; // second row options $menu = '<div class="tsob-menu-row2">'; $menu .= BackendUtility::getFuncCheck($this->pObj->id, 'SET[ts_browser_showComments]', $this->pObj->MOD_SETTINGS['ts_browser_showComments'], '', '', 'id="checkTs_browser_showComments"'); $menu .= '<label for="checkTs_browser_showComments">' . $GLOBALS['LANG']->getLL('displayComments') . '</label>'; $menu .= BackendUtility::getFuncCheck($this->pObj->id, 'SET[ts_browser_alphaSort]', $this->pObj->MOD_SETTINGS['ts_browser_alphaSort'], '', '', 'id="checkTs_browser_alphaSort"'); $menu .= '<label for="checkTs_browser_alphaSort">' . $GLOBALS['LANG']->getLL('sortAlphabetically') . '</label>'; $menu .= BackendUtility::getFuncCheck($this->pObj->id, 'SET[ts_browser_fixedLgd]', $this->pObj->MOD_SETTINGS['ts_browser_fixedLgd'], '', '', 'id="checkTs_browser_fixedLgd"'); $menu .= '<label for="checkTs_browser_fixedLgd">' . $GLOBALS['LANG']->getLL('cropLines') . '</label>'; if ($bType == 'setup' && !$this->pObj->MOD_SETTINGS['ts_browser_fixedLgd']) { $menu .= '<br /><br /><label>' . $GLOBALS['LANG']->getLL('displayConstants') . '</label>'; $menu .= BackendUtility::getFuncMenu($this->pObj->id, 'SET[ts_browser_const]', $this->pObj->MOD_SETTINGS['ts_browser_const'], $this->pObj->MOD_MENU['ts_browser_const']); } $menu .= '</div>'; $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('displayOptions'), '<nobr>' . $menu . '</nobr>', 0, 1); // Conditions: if (is_array($tmpl->sections)) { $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('conditions'), '', 0, 1); $out = ''; foreach ($tmpl->sections as $key => $val) { $out .= '<div class="tsob-conditions"><input class="checkbox" type="checkbox" name="conditions[' . $key . ']" id="check' . $key . '" value="' . htmlspecialchars($val) . '"' . ($this->pObj->MOD_SETTINGS['tsbrowser_conditions'][$key] ? ' checked' : '') . ' />'; $out .= '<label for="check' . $key . '">' . $tmpl->substituteCMarkers(htmlspecialchars($val)) . '</label></div>'; } $theOutput .= '<div class="tsob-menu-row2">' . $out . '</div><input type="Submit" name="Submit" value="' . $GLOBALS['LANG']->getLL('setConditions') . '" />'; } // Ending section: $theOutput .= $this->pObj->doc->sectionEnd(); } return $theOutput; }
/** * Gets the function menu selector for this backend module. * * @return string The HTML representation of the function menu selector */ protected function getFunctionMenu() { return BackendUtility::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']); }