/** * Calls showStats to generate output. * * @return string html table with results from showStats() */ function main() { // Initializes the module. Done in this function because we may need to re-initialize if data is submitted! global $SOBE, $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS; $theOutput .= $this->pObj->doc->spacer(5); $theOutput .= $this->pObj->doc->section($LANG->getLL('title'), $this->showStats(), 0, 1); $menu = array(); $menu[] = t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[tx_indexedsearch_modfunc2_check]', $this->pObj->MOD_SETTINGS['tx_indexedsearch_modfunc2_check'], '', '', 'id="checkTx_indexedsearch_modfunc2_check"') . '<label for="checkTx_indexedsearch_modfunc2_check"' . $LANG->getLL('checklabel') . '</label>'; $theOutput .= $this->pObj->doc->spacer(5); return $theOutput; }
function workspaceMenu() { if ($this->id) { $menu = ''; if ($GLOBALS['BE_USER']->workspace === 0) { $menu .= t3lib_BEfunc::getFuncMenu($this->id, 'SET[filter]', $this->MOD_SETTINGS['filter'], $this->MOD_MENU['filter']); $menu .= t3lib_BEfunc::getFuncMenu($this->id, 'SET[display]', $this->MOD_SETTINGS['display'], $this->MOD_MENU['display']); } if (!$this->details && $GLOBALS['BE_USER']->workspace && !$this->diffOnly) { $menu .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[diff]', $this->MOD_SETTINGS['diff'], '', '', 'id="checkDiff"') . ' <label for="checkDiff">' . $GLOBALS['LANG']->getLL('showDiffView') . '</label>'; } if ($menu) { return $menu; } } }
/** * Main function, starting the rendering of the list. * * @return void */ function main() { global $BE_USER, $LANG, $BACK_PATH, $CLIENT; // Start document template object: $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $BACK_PATH; $this->doc->setModuleTemplate('templates/db_list.html'); // Loading current page record and checking access: $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; // Initialize the dblist object: $dblist = t3lib_div::makeInstance('localRecordList'); $dblist->backPath = $BACK_PATH; $dblist->calcPerms = $BE_USER->calcPerms($this->pageinfo); $dblist->thumbs = $BE_USER->uc['thumbnailsByDefault']; $dblist->returnUrl = $this->returnUrl; $dblist->allFields = $this->MOD_SETTINGS['bigControlPanel'] || $this->table ? 1 : 0; $dblist->localizationView = $this->MOD_SETTINGS['localization']; $dblist->showClipboard = 1; $dblist->disableSingleTableView = $this->modTSconfig['properties']['disableSingleTableView']; $dblist->listOnlyInSingleTableMode = $this->modTSconfig['properties']['listOnlyInSingleTableView']; $dblist->hideTables = $this->modTSconfig['properties']['hideTables']; $dblist->tableTSconfigOverTCA = $this->modTSconfig['properties']['table.']; $dblist->clickTitleMode = $this->modTSconfig['properties']['clickTitleMode']; $dblist->alternateBgColors = $this->modTSconfig['properties']['alternateBgColors'] ? 1 : 0; $dblist->allowedNewTables = t3lib_div::trimExplode(',', $this->modTSconfig['properties']['allowedNewTables'], 1); $dblist->deniedNewTables = t3lib_div::trimExplode(',', $this->modTSconfig['properties']['deniedNewTables'], 1); $dblist->newWizards = $this->modTSconfig['properties']['newWizards'] ? 1 : 0; $dblist->pageRow = $this->pageinfo; $dblist->counter++; $dblist->MOD_MENU = array('bigControlPanel' => '', 'clipBoard' => '', 'localization' => ''); $dblist->modTSconfig = $this->modTSconfig; // Clipboard is initialized: $dblist->clipObj = t3lib_div::makeInstance('t3lib_clipboard'); // Start clipboard $dblist->clipObj->initializeClipboard(); // Initialize - reads the clipboard content from the user session // Clipboard actions are handled: $CB = t3lib_div::_GET('CB'); // CB is the clipboard command array if ($this->cmd == 'setCB') { // CBH is all the fields selected for the clipboard, CBC is the checkbox fields which were checked. By merging we get a full array of checked/unchecked elements // This is set to the 'el' array of the CB after being parsed so only the table in question is registered. $CB['el'] = $dblist->clipObj->cleanUpCBC(array_merge((array) t3lib_div::_POST('CBH'), (array) t3lib_div::_POST('CBC')), $this->cmd_table); } if (!$this->MOD_SETTINGS['clipBoard']) { $CB['setP'] = 'normal'; } // If the clipboard is NOT shown, set the pad to 'normal'. $dblist->clipObj->setCmd($CB); // Execute commands. $dblist->clipObj->cleanCurrent(); // Clean up pad $dblist->clipObj->endClipboard(); // Save the clipboard content // This flag will prevent the clipboard panel in being shown. // It is set, if the clickmenu-layer is active AND the extended view is not enabled. $dblist->dontShowClipControlPanels = $CLIENT['FORMSTYLE'] && !$this->MOD_SETTINGS['bigControlPanel'] && $dblist->clipObj->current == 'normal' && !$BE_USER->uc['disableCMlayers'] && !$this->modTSconfig['properties']['showClipControlPanelsDespiteOfCMlayers']; // If there is access to the page, then render the list contents and set up the document template object: if ($access) { // Deleting records...: // Has not to do with the clipboard but is simply the delete action. The clipboard object is used to clean up the submitted entries to only the selected table. if ($this->cmd == 'delete') { $items = $dblist->clipObj->cleanUpCBC(t3lib_div::_POST('CBC'), $this->cmd_table, 1); if (count($items)) { $cmd = array(); foreach ($items as $iK => $value) { $iKParts = explode('|', $iK); $cmd[$iKParts[0]][$iKParts[1]]['delete'] = 1; } $tce = t3lib_div::makeInstance('t3lib_TCEmain'); $tce->stripslashes_values = 0; $tce->start(array(), $cmd); $tce->process_cmdmap(); if (isset($cmd['pages'])) { t3lib_BEfunc::setUpdateSignal('updatePageTree'); } $tce->printLogErrorMessages(t3lib_div::getIndpEnv('REQUEST_URI')); } } // Initialize the listing object, dblist, for rendering the list: $this->pointer = t3lib_div::intInRange($this->pointer, 0, 100000); $dblist->start($this->id, $this->table, $this->pointer, $this->search_field, $this->search_levels, $this->showLimit); $dblist->setDispFields(); // Render versioning selector: if (t3lib_extMgm::isLoaded('version')) { $dblist->HTMLcode .= $this->doc->getVersionSelector($this->id); } // Render the list of tables: $dblist->generateList(); // Write the bottom of the page: $dblist->writeBottom(); // Add JavaScript functions to the page: $this->doc->JScode = $this->doc->wrapScriptTags(' function jumpToUrl(URL) { // window.location.href = URL; return false; } function jumpExt(URL,anchor) { // var anc = anchor?anchor:""; window.location.href = URL+(T3_THIS_LOCATION?"&returnUrl="+T3_THIS_LOCATION:"")+anc; return false; } function jumpSelf(URL) { // window.location.href = URL+(T3_RETURN_URL?"&returnUrl="+T3_RETURN_URL:""); return false; } function setHighlight(id) { // top.fsMod.recentIds["web"]=id; top.fsMod.navFrameHighlightedID["web"]="pages"+id+"_"+top.fsMod.currentBank; // For highlighting if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) { top.content.nav_frame.refresh_nav(); } } ' . $this->doc->redirectUrls($dblist->listURL()) . ' ' . $dblist->CBfunctions() . ' function editRecords(table,idList,addParams,CBflag) { // window.location.href="' . $BACK_PATH . 'alt_doc.php?returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . '&edit["+table+"]["+idList+"]=edit"+addParams; } function editList(table,idList) { // var list=""; // Checking how many is checked, how many is not var pointer=0; var pos = idList.indexOf(","); while (pos!=-1) { if (cbValue(table+"|"+idList.substr(pointer,pos-pointer))) { list+=idList.substr(pointer,pos-pointer)+","; } pointer=pos+1; pos = idList.indexOf(",",pointer); } if (cbValue(table+"|"+idList.substr(pointer))) { list+=idList.substr(pointer)+","; } return list ? list : idList; } if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . '; '); // Setting up the context sensitive menu: $this->doc->getContextMenuCode(); } // access // Begin to compile the whole page, starting out with page header: $this->body = ''; $this->body .= '<form action="' . htmlspecialchars($dblist->listURL()) . '" method="post" name="dblistForm">'; $this->body .= $dblist->HTMLcode; $this->body .= '<input type="hidden" name="cmd_table" /><input type="hidden" name="cmd" /></form>'; // If a listing was produced, create the page footer with search form etc: if ($dblist->HTMLcode) { // Making field select box (when extended view for a single table is enabled): if ($dblist->table) { $this->body .= $dblist->fieldSelectBox($dblist->table); } // Adding checkbox options for extended listing and clipboard display: $this->body .= ' <!-- Listing options for clipboard and thumbnails --> <div id="typo3-listOptions"> <form action="" method="post">'; $this->body .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[bigControlPanel]', $this->MOD_SETTINGS['bigControlPanel'], 'db_list.php', $this->table ? '&table=' . $this->table : '', 'id="checkLargeControl"') . ' <label for="checkLargeControl">' . $LANG->getLL('largeControl', 1) . '</label><br />'; if ($dblist->showClipboard) { $this->body .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[clipBoard]', $this->MOD_SETTINGS['clipBoard'], 'db_list.php', $this->table ? '&table=' . $this->table : '', 'id="checkShowClipBoard"') . ' <label for="checkShowClipBoard">' . $LANG->getLL('showClipBoard', 1) . '</label><br />'; } $this->body .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[localization]', $this->MOD_SETTINGS['localization'], 'db_list.php', $this->table ? '&table=' . $this->table : '', 'id="checkLocalization"') . ' <label for="checkLocalization">' . $LANG->getLL('localization', 1) . '</label><br />'; $this->body .= ' </form> </div>'; $this->body .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_options', $GLOBALS['BACK_PATH']); // Printing clipboard if enabled: if ($this->MOD_SETTINGS['clipBoard'] && $dblist->showClipboard) { $this->body .= $dblist->clipObj->printClipboard(); $this->body .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_clipboard', $GLOBALS['BACK_PATH']); } // Search box: $this->body .= $dblist->getSearchBox(); // Display sys-notes, if any are found: $this->body .= $dblist->showSysNotesForPage(); } // Setting up the buttons and markers for docheader $docHeaderButtons = $dblist->getButtons(); $markers = array('CSH' => $docHeaderButtons['csh'], 'CONTENT' => $this->body); // Build the <body> for the module $this->content = $this->doc->startPage('DB list'); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Renders the display of Data Structure Objects. * * @return void */ function renderDSO() { global $TYPO3_DB; if (intval($this->displayUid) > 0) { $row = t3lib_BEfunc::getRecordWSOL('tx_templavoila_datastructure', $this->displayUid); if (is_array($row)) { // Get title and icon: $icon = t3lib_iconworks::getIconImage('tx_templavoila_datastructure', $row, $GLOBALS['BACK_PATH'], ' align="top" title="UID: ' . $this->displayUid . '"'); $title = t3lib_BEfunc::getRecordTitle('tx_templavoila_datastructure', $row, 1); $content .= $this->doc->wrapClickMenuOnIcon($icon, 'tx_templavoila_datastructure', $row['uid'], 1) . '<strong>' . $title . '</strong><br />'; // Get Data Structure: $origDataStruct = $dataStruct = $this->getDataStructFromDSO($row['dataprot']); if (is_array($dataStruct)) { // Showing Data Structure: $tRows = $this->drawDataStructureMap($dataStruct); $content .= ' <!-- Data Structure content: --> <div id="c-ds"> <h4>Data Structure in record:</h4> <table border="0" cellspacing="2" cellpadding="2"> <tr class="bgColor5"> <td nowrap="nowrap"><strong>Data Element:</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_head_dataElement', $this->doc->backPath, '', TRUE) . '</td> <td nowrap="nowrap"><strong>Mapping instructions:</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_head_mapping_instructions', $this->doc->backPath, '', TRUE) . '</td> <td nowrap="nowrap"><strong>Rules:</strong>' . $this->cshItem('xMOD_tx_templavoila', 'mapping_head_Rules', $this->doc->backPath, '', TRUE) . '</td> </tr> ' . implode('', $tRows) . ' </table> </div>'; // CSH $content .= $this->cshItem('xMOD_tx_templavoila', 'mapping_ds', $this->doc->backPath); } else { $content .= '<h4>' . $GLOBALS['LANG']->getLL('error') . ': ' . $GLOBALS['LANG']->getLL('noDSDefined') . '</h4>'; } // Get Template Objects pointing to this Data Structure $res = $TYPO3_DB->exec_SELECTquery('*', 'tx_templavoila_tmplobj', 'pid IN (' . $this->storageFolders_pidList . ') AND datastructure=' . intval($row['uid']) . t3lib_BEfunc::deleteClause('tx_templavoila_tmplobj') . t3lib_BEfunc::versioningPlaceholderClause('tx_templavoila_tmplobj')); $tRows = array(); $tRows[] = ' <tr class="bgColor5"> <td><strong>Uid:</strong></td> <td><strong>Title:</strong></td> <td><strong>File reference:</strong></td> <td><strong>Mapping Data Lgd:</strong></td> </tr>'; $TOicon = t3lib_iconworks::getIconImage('tx_templavoila_tmplobj', array(), $GLOBALS['BACK_PATH'], ' align="top"'); // Listing Template Objects with links: while (false !== ($TO_Row = $TYPO3_DB->sql_fetch_assoc($res))) { t3lib_BEfunc::workspaceOL('tx_templavoila_tmplobj', $TO_Row); $tRows[] = ' <tr class="bgColor4"> <td>[' . $TO_Row['uid'] . ']</td> <td nowrap="nowrap">' . $this->doc->wrapClickMenuOnIcon($TOicon, 'tx_templavoila_tmplobj', $TO_Row['uid'], 1) . '<a href="' . htmlspecialchars('index.php?table=tx_templavoila_tmplobj&uid=' . $TO_Row['uid'] . '&_reload_from=1') . '">' . t3lib_BEfunc::getRecordTitle('tx_templavoila_tmplobj', $TO_Row, 1) . '</a>' . '</td> <td nowrap="nowrap">' . htmlspecialchars($TO_Row['fileref']) . ' <strong>' . (!t3lib_div::getFileAbsFileName($TO_Row['fileref'], 1) ? '(NOT FOUND!)' : '(OK)') . '</strong></td> <td>' . strlen($TO_Row['templatemapping']) . '</td> </tr>'; } $content .= ' <!-- Template Objects attached to Data Structure Record: --> <div id="c-to"> <h4>Template Objects using this Data Structure:</h4> <table border="0" cellpadding="2" cellspacing="2"> ' . implode('', $tRows) . ' </table> </div>'; // CSH $content .= $this->cshItem('xMOD_tx_templavoila', 'mapping_ds_to', $this->doc->backPath); // Display XML of data structure: if (is_array($dataStruct)) { require_once PATH_t3lib . 'class.t3lib_syntaxhl.php'; // Make instance of syntax highlight class: $hlObj = t3lib_div::makeInstance('t3lib_syntaxhl'); $dataStructureXML = t3lib_div::array2xml_cs($origDataStruct, 'T3DataStructure', array('useCDATA' => 1)); $content .= ' <!-- Data Structure XML: --> <br /> <div id="c-dsxml"> <h3>Data Structure XML:</h3> ' . $this->cshItem('xMOD_tx_templavoila', 'mapping_ds_showXML', $this->doc->backPath) . ' <p>' . t3lib_BEfunc::getFuncCheck('', 'SET[showDSxml]', $this->MOD_SETTINGS['showDSxml'], '', t3lib_div::implodeArrayForUrl('', $_GET, '', 1, 1)) . ' Show XML</p> <pre>' . ($this->MOD_SETTINGS['showDSxml'] ? $hlObj->highLight_DS($dataStructureXML) : '') . ' </pre> </div> '; } } else { $content .= 'ERROR: No Data Structure Record with the UID ' . $this->displayUid; } $this->content .= $this->doc->section('Data Structure Object', $content, 0, 1); } else { $this->content .= $this->doc->section('Data Structure Object ERROR', 'No UID was found pointing to a Data Structure Object record.', 0, 1, 3); } }
/** * Main function, creating the listing * * @return void */ function main() { global $BE_USER, $LANG, $BACK_PATH, $TYPO3_CONF_VARS, $FILEMOUNTS; // Initialize the template object $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $BACK_PATH; $this->doc->setModuleTemplate('templates/file_list.html'); $this->doc->getPageRenderer()->loadPrototype(); // Validating the input "id" (the path, directory!) and checking it against the mounts of the user. $this->id = $this->basicFF->is_directory($this->id); $access = $this->id && $this->basicFF->checkPathAgainstMounts($this->id . '/'); // There there was access to this file path, continue, make the list if ($access) { // include the initialization for the flash uploader if ($GLOBALS['BE_USER']->uc['enableFlashUploader']) { $this->doc->JScodeArray['flashUploader'] = ' if (top.TYPO3.FileUploadWindow.isFlashAvailable()) { document.observe("dom:loaded", function() { // monitor the button $("button-upload").observe("click", initFlashUploader); function initFlashUploader(event) { // set the page specific options for the flashUploader var flashUploadOptions = { uploadURL: top.TS.PATH_typo3 + "ajax.php", uploadFileSizeLimit: "' . t3lib_div::getMaxUploadFileSize() . '", uploadFileTypes: { allow: "' . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']['webspace']['allow'] . '", deny: "' . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']['webspace']['deny'] . '" }, uploadFilePostName: "upload_1", uploadPostParams: { "file[upload][1][target]": "' . $this->id . '", "file[upload][1][data]": 1, "file[upload][1][charset]": "utf-8", "ajaxID": "TYPO3_tcefile::process" } }; // get the flashUploaderWindow instance from the parent frame var flashUploader = top.TYPO3.FileUploadWindow.getInstance(flashUploadOptions); // add an additional function inside the container to show the checkbox option var infoComponent = new top.Ext.Panel({ autoEl: { tag: "div" }, height: "auto", bodyBorder: false, border: false, hideBorders: true, cls: "t3-upload-window-infopanel", id: "t3-upload-window-infopanel-addition", html: \'<label for="overrideExistingFilesCheckbox"><input id="overrideExistingFilesCheckbox" type="checkbox" onclick="setFlashPostOptionOverwriteExistingFiles(this);" />\' + top.String.format(top.TYPO3.LLL.fileUpload.infoComponentOverrideFiles) + \'</label>\' }); flashUploader.add(infoComponent); // do a reload of this frame once all uploads are done flashUploader.on("totalcomplete", function() { window.location.reload(); }); // this is the callback function that delivers the additional post parameter to the flash application top.setFlashPostOptionOverwriteExistingFiles = function(checkbox) { var uploader = top.TYPO3.getInstance("FileUploadWindow"); if (uploader.isVisible()) { uploader.swf.addPostParam("overwriteExistingFiles", (checkbox.checked == true ? 1 : 0)); } }; event.stop(); }; }); } '; } // Create filelisting object $this->filelist = t3lib_div::makeInstance('fileList'); $this->filelist->backPath = $BACK_PATH; // Apply predefined values for hidden checkboxes // Set predefined value for DisplayBigControlPanel: if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'activated') { $this->MOD_SETTINGS['bigControlPanel'] = TRUE; } elseif ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'deactivated') { $this->MOD_SETTINGS['bigControlPanel'] = FALSE; } // Set predefined value for DisplayThumbnails: if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'activated') { $this->MOD_SETTINGS['displayThumbs'] = TRUE; } elseif ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'deactivated') { $this->MOD_SETTINGS['displayThumbs'] = FALSE; } // Set predefined value for Clipboard: if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableClipBoard') === 'activated') { $this->MOD_SETTINGS['clipBoard'] = TRUE; } elseif ($GLOBALS['BE_USER']->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'] = $BE_USER->uc['thumbnailsByDefault']; } $this->filelist->thumbs = $this->MOD_SETTINGS['displayThumbs']; // Create clipboard object and initialize that $this->filelist->clipObj = t3lib_div::makeInstance('t3lib_clipboard'); $this->filelist->clipObj->fileMode = 1; $this->filelist->clipObj->initializeClipboard(); $CB = t3lib_div::_GET('CB'); if ($this->cmd == 'setCB') { $CB['el'] = $this->filelist->clipObj->cleanUpCBC(array_merge(t3lib_div::_POST('CBH'), t3lib_div::_POST('CBC')), '_FILE'); } if (!$this->MOD_SETTINGS['clipBoard']) { $CB['setP'] = 'normal'; } $this->filelist->clipObj->setCmd($CB); $this->filelist->clipObj->cleanCurrent(); $this->filelist->clipObj->endClipboard(); // Saves // If the "cmd" was to delete files from the list (clipboard thing), do that: if ($this->cmd == 'delete') { $items = $this->filelist->clipObj->cleanUpCBC(t3lib_div::_POST('CBC'), '_FILE', 1); if (count($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 = t3lib_div::makeInstance('t3lib_extFileFunctions'); $fileProcessor->init($FILEMOUNTS, $TYPO3_CONF_VARS['BE']['fileExtensions']); $fileProcessor->init_actionPerms($GLOBALS['BE_USER']->getFileoperationPermissions()); $fileProcessor->dontCheckForUnique = $this->overwriteExistingFiles ? 1 : 0; $fileProcessor->start($FILE); $fileProcessor->processData(); $fileProcessor->printLogErrorMessages(); } } 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 = t3lib_div::intInRange($this->pointer, 0, 100000); $this->filelist->start($this->id, $this->pointer, $this->MOD_SETTINGS['sort'], $this->MOD_SETTINGS['reverse'], $this->MOD_SETTINGS['clipBoard'], $this->MOD_SETTINGS['bigControlPanel']); // Generate the list $this->filelist->generateList(); // Write the footer $this->filelist->writeBottom(); // Set top JavaScript: $this->doc->JScode = $this->doc->wrapScriptTags(' if (top.fsMod) top.fsMod.recentIds["file"] = unescape("' . rawurlencode($this->id) . '"); function jumpToUrl(URL) { // window.location.href = URL; } ' . $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->id); // add the folder info to the marker array $otherMarkers['FOLDER_INFO'] = $this->filelist->getFolderInfo(); $docHeaderButtons = array_merge($this->getButtons(), $buttons); // Build the <body> for the module // Create output $pageContent = ''; $pageContent .= '<form action="' . htmlspecialchars($this->filelist->listURL()) . '" method="post" name="dblistForm">'; $pageContent .= $this->filelist->HTMLcode; $pageContent .= '<input type="hidden" name="cmd" /></form>'; if ($this->filelist->HTMLcode) { // Making listing options: $pageContent .= ' <!-- Listing options for extended view, clipboard and thumbnails --> <div id="typo3-listOptions"> '; // Add "display bigControlPanel" checkbox: if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'selectable') { $pageContent .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[bigControlPanel]', $this->MOD_SETTINGS['bigControlPanel'], 'file_list.php', '', 'id="bigControlPanel"') . '<label for="bigControlPanel"> ' . $GLOBALS['LANG']->getLL('bigControlPanel', TRUE) . '</label><br />'; } // Add "display thumbnails" checkbox: if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'selectable') { $pageContent .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[displayThumbs]', $this->MOD_SETTINGS['displayThumbs'], 'file_list.php', '', 'id="checkDisplayThumbs"') . ' <label for="checkDisplayThumbs">' . $GLOBALS['LANG']->getLL('displayThumbs', TRUE) . '</label><br />'; } // Add "clipboard" checkbox: if ($GLOBALS['BE_USER']->getTSConfigVal('options.file_list.enableClipBoard') === 'selectable') { $pageContent .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[clipBoard]', $this->MOD_SETTINGS['clipBoard'], 'file_list.php', '', 'id="checkClipBoard"') . ' <label for="checkClipBoard">' . $GLOBALS['LANG']->getLL('clipBoard', TRUE) . '</label>'; } $pageContent .= ' </div> '; // Set clipboard: if ($this->MOD_SETTINGS['clipBoard']) { $pageContent .= $this->filelist->clipObj->printClipboard(); $pageContent .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filelist_clipboard', $GLOBALS['BACK_PATH']); } } $markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $pageContent); $this->content = $this->doc->moduleBody(array(), $docHeaderButtons, array_merge($markerArray, $otherMarkers)); // Renders the module page $this->content = $this->doc->render($LANG->getLL('files'), $this->content); } else { // Create output - no access (no warning though) $this->content = $this->doc->render($LANG->getLL('files'), ''); } }
/** * Create the checkbox buttons in the bottom of the pages. * * @return string HTML for function menus. */ function functionMenus() { global $LANG; if ($GLOBALS['BE_USER']->getTSConfigVal('options.enableShowPalettes')) { // Show palettes: return ' <!-- Function menu (checkbox for showing all palettes): --> <br />' . t3lib_BEfunc::getFuncCheck('', 'SET[showPalettes]', $this->MOD_SETTINGS['showPalettes'], 'alt_doc.php', t3lib_div::implodeArrayForUrl('', array_merge($this->R_URL_getvars, array('SET' => ''))) . t3lib_BEfunc::getUrlToken('editRecord'), 'id="checkShowPalettes"') . '<label for="checkShowPalettes">' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPalettes', 1) . '</label>'; } else { return ''; } }
/** * Main function * * @return string HTML output */ function main() { global $LANG, $BACK_PATH; $this->incLocalLang(); $this->loadExtensionSettings(); if (empty($this->pObj->MOD_SETTINGS['processListMode'])) { $this->pObj->MOD_SETTINGS['processListMode'] = 'simple'; } // Set CSS styles specific for this document: $this->pObj->content = str_replace('/*###POSTCSSMARKER###*/', ' TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; } ', $this->pObj->content); $this->pObj->content .= '<style type="text/css"><!-- table.url-table, table.param-expanded, table.crawlerlog { border-bottom: 1px solid grey; border-spacing: 0; border-collapse: collapse; } table.crawlerlog td, table.url-table td { border: 1px solid lightgrey; border-bottom: 1px solid grey; white-space: nowrap; vertical-align: top; } --></style> <link rel="stylesheet" type="text/css" href="' . $BACK_PATH . '../typo3conf/ext/crawler/template/res.css" /> '; // Type function menu: $h_func = t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[crawlaction]', $this->pObj->MOD_SETTINGS['crawlaction'], $this->pObj->MOD_MENU['crawlaction'], 'index.php'); /* // Showing depth-menu in certain cases: if ($this->pObj->MOD_SETTINGS['crawlaction']!=='cli' && $this->pObj->MOD_SETTINGS['crawlaction']!== 'multiprocess' && ($this->pObj->MOD_SETTINGS['crawlaction']!=='log' || $this->pObj->id)) { $h_func .= t3lib_BEfunc::getFuncMenu( $this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php' ); } */ // Additional menus for the log type: if ($this->pObj->MOD_SETTINGS['crawlaction'] === 'log') { $h_func .= t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php'); $quiPart = t3lib_div::_GP('qid_details') ? '&qid_details=' . intval(t3lib_div::_GP('qid_details')) : ''; $setId = intval(t3lib_div::_GP('setID')); $h_func .= '<hr/>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.display') . ': ' . t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[log_display]', $this->pObj->MOD_SETTINGS['log_display'], $this->pObj->MOD_MENU['log_display'], 'index.php', '&setID=' . $setId) . ' - ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showresultlog') . ': ' . t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[log_resultLog]', $this->pObj->MOD_SETTINGS['log_resultLog'], 'index.php', '&setID=' . $setId . $quiPart) . ' - ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.showfevars') . ': ' . t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[log_feVars]', $this->pObj->MOD_SETTINGS['log_feVars'], 'index.php', '&setID=' . $setId . $quiPart) . ' - ' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.itemsPerPage') . ': ' . t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[itemsPerPage]', $this->pObj->MOD_SETTINGS['itemsPerPage'], $this->pObj->MOD_MENU['itemsPerPage'], 'index.php'); } $theOutput = $this->pObj->doc->spacer(5); $theOutput .= $this->pObj->doc->section($LANG->getLL('title'), $h_func, 0, 1); // Branch based on type: switch ((string) $this->pObj->MOD_SETTINGS['crawlaction']) { case 'start': if (empty($this->pObj->id)) { $theOutput .= '<br />' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.noPageSelected'); } else { $theOutput .= $this->pObj->doc->section('', $this->drawURLs(), 0, 1); } break; case 'log': $theOutput .= $this->pObj->doc->section('', $this->drawLog(), 0, 1); break; case 'cli': $theOutput .= $this->pObj->doc->section('', $this->drawCLIstatus(), 0, 1); break; case 'multiprocess': $theOutput .= $this->pObj->doc->section('', $this->drawProcessOverviewAction(), 0, 1); break; } return $theOutput; }
/** * [Describe function...] * * @param [type] $modSettings: ... * @param [type] $enableList: ... * @return [type] ... */ function makeSelectorTable($modSettings, $enableList = 'table,fields,query,group,order,limit') { $enableArr = explode(',', $enableList); // Make output $TDparams = ' class="bgColor5" nowrap'; if (in_array('table', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableSelectATable']) { $out = ' <tr> <td' . $TDparams . '><strong>Select a table:</strong></td> <td' . $TDparams . '>' . $this->mkTableSelect('SET[queryTable]', $this->table) . '</td> </tr>'; } if ($this->table) { // Init fields: $this->setAndCleanUpExternalLists('queryFields', $modSettings['queryFields'], 'uid,' . $this->getLabelCol()); $this->setAndCleanUpExternalLists('queryGroup', $modSettings['queryGroup']); $this->setAndCleanUpExternalLists('queryOrder', $modSettings['queryOrder'] . ',' . $modSettings['queryOrder2']); // Limit: $this->extFieldLists['queryLimit'] = $modSettings['queryLimit']; if (!$this->extFieldLists['queryLimit']) { $this->extFieldLists['queryLimit'] = 100; } $parts = t3lib_div::intExplode(',', $this->extFieldLists['queryLimit']); if ($parts[1]) { $this->limitBegin = $parts[0]; $this->limitLength = $parts[1]; } else { $this->limitLength = $this->extFieldLists['queryLimit']; } $this->extFieldLists['queryLimit'] = implode(',', array_slice($parts, 0, 2)); // Insert Descending parts if ($this->extFieldLists['queryOrder']) { $descParts = explode(',', $modSettings['queryOrderDesc'] . ',' . $modSettings['queryOrder2Desc']); $orderParts = explode(',', $this->extFieldLists['queryOrder']); $reList = array(); foreach ($orderParts as $kk => $vv) { $reList[] = $vv . ($descParts[$kk] ? ' DESC' : ''); } $this->extFieldLists['queryOrder_SQL'] = implode(',', $reList); } // Query Generator: $this->procesData($modSettings['queryConfig'] ? unserialize($modSettings['queryConfig']) : ''); // debug($this->queryConfig); $this->queryConfig = $this->cleanUpQueryConfig($this->queryConfig); // debug($this->queryConfig); $this->enableQueryParts = $modSettings['search_query_smallparts']; $codeArr = $this->getFormElements(); $queryCode = $this->printCodeArray($codeArr); if (in_array('fields', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableSelectFields']) { $out .= ' <tr> <td' . $TDparams . '><strong>Select fields:</strong></td> <td' . $TDparams . '>' . $this->mkFieldToInputSelect('SET[queryFields]', $this->extFieldLists['queryFields']) . '</td> </tr>'; } if (in_array('query', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableMakeQuery']) { $out .= '<tr> <td colspan="2"' . $TDparams . '><strong>Make Query:</strong></td> </tr> <tr> <td colspan="2">' . $queryCode . '</td> </tr> '; } if (in_array('group', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableGroupBy']) { $out .= '<tr> <td' . $TDparams . '><strong>Group By:</strong></td> <td' . $TDparams . '>' . $this->mkTypeSelect('SET[queryGroup]', $this->extFieldLists['queryGroup'], '') . '</td> </tr>'; } if (in_array('order', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableOrderBy']) { $orderByArr = explode(',', $this->extFieldLists['queryOrder']); // debug($orderByArr); $orderBy = ''; $orderBy .= $this->mkTypeSelect('SET[queryOrder]', $orderByArr[0], '') . ' ' . t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[queryOrderDesc]', $modSettings['queryOrderDesc'], '', '', 'id="checkQueryOrderDesc"') . ' <label for="checkQueryOrderDesc">Descending</label>'; if ($orderByArr[0]) { $orderBy .= '<BR>' . $this->mkTypeSelect('SET[queryOrder2]', $orderByArr[1], '') . ' ' . t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[queryOrder2Desc]', $modSettings['queryOrder2Desc'], '', '', 'id="checkQueryOrder2Desc"') . ' <label for="checkQueryOrder2Desc">Descending</label>'; } $out .= '<tr> <td' . $TDparams . '><strong>Order By:</strong></td> <td' . $TDparams . '>' . $orderBy . '</td> </tr>'; } if (in_array('limit', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableLimit']) { $limit = '<input type="Text" value="' . htmlspecialchars($this->extFieldLists['queryLimit']) . '" name="SET[queryLimit]" id="queryLimit"' . $GLOBALS['TBE_TEMPLATE']->formWidth(10) . '>' . $this->updateIcon(); $prevLimit = $this->limitBegin - $this->limitLength < 0 ? 0 : $this->limitBegin - $this->limitLength; if ($this->limitBegin) { $prevButton = '<input type="button" value="previous ' . $this->limitLength . '" onclick=\'document.getElementById("queryLimit").value="' . $prevLimit . ',' . $this->limitLength . '";document.forms[0].submit();\'>'; } if (!$this->limitLength) { $this->limitLength = 100; } $nextLimit = $this->limitBegin + $this->limitLength; if ($nextLimit < 0) { $nextLimit = 0; } if ($nextLimit) { $nextButton = '<input type="button" value="next ' . $this->limitLength . '" onclick=\'document.getElementById("queryLimit").value="' . $nextLimit . ',' . $this->limitLength . '";document.forms[0].submit();\'>'; } $numberButtons = '<input type="button" value="10" onclick=\'document.getElementById("queryLimit").value="10";document.forms[0].submit();\'>'; $numberButtons .= '<input type="button" value="20" onclick=\'document.getElementById("queryLimit").value="20";document.forms[0].submit();\'>'; $numberButtons .= '<input type="button" value="50" onclick=\'document.getElementById("queryLimit").value="50";document.forms[0].submit();\'>'; $numberButtons .= '<input type="button" value="100" onclick=\'document.getElementById("queryLimit").value="100";document.forms[0].submit();\'>'; $out .= '<tr> <td' . $TDparams . '><strong>Limit:</strong></td> <td' . $TDparams . '>' . $limit . $prevButton . $nextButton . ' ' . $numberButtons . '</td> </tr> '; } } $out = '<table border="0" cellpadding="3" cellspacing="1" class="qg-make-query">' . $out . '</table>'; $out .= $this->JSbottom($this->formName); return $out; }
/** * [Describe function...] * * @return [type] ... */ function main() { global $SOBE, $BE_USER, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS; global $tmpl, $tplRow, $theConstants; $POST = t3lib_div::_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"]; } // ************************** // Main // ************************** // BUGBUG: Should we check if the uset 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 .= '<h4 style="margin-bottom:5px;">' . $GLOBALS['LANG']->getLL('currentTemplate') . ' <img ' . t3lib_iconWorks::skinImg($BACK_PATH, t3lib_iconWorks::getIcon('sys_template', $tplRow)) . ' align="top" /> <strong>' . $this->pObj->linkWrapTemplateTitle($tplRow["title"], $bType == "setup" ? "config" : "constants") . '</strong>' . htmlspecialchars(trim($tplRow["sitetitle"]) ? ' - (' . $tplRow["sitetitle"] . ')' : '') . '</h4>'; if ($manyTemplatesMenu) { $theOutput .= $this->pObj->doc->section("", $manyTemplatesMenu); $theOutput .= $this->pObj->doc->divider(5); } 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 = t3lib_div::makeInstance('t3lib_FlashMessage', $GLOBALS['LANG']->getLL('noSpaces') . '<br />' . $GLOBALS['LANG']->getLL('nothingUpdated'), $GLOBALS['LANG']->getLL('badProperty'), t3lib_FlashMessage::ERROR); t3lib_FlashMessageQueue::addMessage($badPropertyMessage); } else { $pline = $name . '.' . $property . ' = ' . trim($POST['data'][$name]['propertyValue']); $propertyAddedMessage = t3lib_div::makeInstance('t3lib_FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('propertyAdded')); t3lib_FlashMessageQueue::addMessage($propertyAddedMessage); $line .= LF . $pline; } } elseif ($POST['update_value']) { $pline = $name . " = " . trim($POST['data'][$name]['value']); $updatedMessage = t3lib_div::makeInstance('t3lib_FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('valueUpdated')); t3lib_FlashMessageQueue::addMessage($updatedMessage); $line .= LF . $pline; } elseif ($POST['clear_object']) { if ($POST['data'][$name]['clearValue']) { $pline = $name . ' >'; $objectClearedMessage = t3lib_div::makeInstance('t3lib_FlashMessage', htmlspecialchars($pline), $GLOBALS['LANG']->getLL('objectCleared')); t3lib_FlashMessageQueue::addMessage($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 = t3lib_div::makeInstance("t3lib_TCEmain"); $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 = t3lib_div::_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->uplPath = PATH_site . $tmpl->uplPath; $tmpl->removeFromGetFilePath = PATH_site; //debug($tmpl->uplPath); if ($this->pObj->MOD_SETTINGS["ts_browser_type"] == "const") { $tmpl->ext_constants_BRP = intval(t3lib_div::_GP("breakPointLN")); } else { $tmpl->ext_config_BRP = intval(t3lib_div::_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 if (t3lib_extMgm::isLoaded("tsconfig_help")) { $url = $BACK_PATH . "wizard_tsconfig.php?mode=tsref&onlyProperty=1"; $params = array(); $params["formName"] = "editForm"; $params["itemName"] = "data[" . htmlspecialchars($this->pObj->sObj) . "][name]"; $params["itemValue"] = "data[" . htmlspecialchars($this->pObj->sObj) . "][propertyValue]"; $TSicon = '<a href="#" onClick="vHWin=window.open(\'' . $url . t3lib_div::implodeArrayForUrl("", array("P" => $params)) . '\',\'popUp' . $md5ID . '\',\'height=500,width=780,status=0,menubar=0,scrollbars=1\');vHWin.focus();return false;"><img src="' . $BACK_PATH . 'gfx/wizard_tsconfig_s.gif" width="22" height="16" border="0" class="absmiddle" hspace=2 title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:tsRef') . '"></a>'; } else { $TSicon = ""; } $out = ''; $out = '<nobr>' . htmlspecialchars($this->pObj->sObj) . '.'; $out .= '<input type="Text" name="data[' . htmlspecialchars($this->pObj->sObj) . '][name]"' . $GLOBALS['TBE_TEMPLATE']->formWidth(20) . ' />' . $TSicon . ' = </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 = t3lib_div::makeInstance('t3lib_FlashMessage', $GLOBALS['LANG']->getLL('noCurrentTemplate'), $GLOBALS['LANG']->getLL('edit'), t3lib_FlashMessage::ERROR); t3lib_FlashMessageQueue::addMessage($noTemplateMessage); } // Links: $out = ''; if (!$this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][$this->pObj->sObj]) { if (count($theSetup)) { $out = '<a href="index.php?id=' . $this->pObj->id . '&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="index.php?id=' . $this->pObj->id . '&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="index.php?id=' . $this->pObj->id . '"><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 (t3lib_div::_POST('search') && t3lib_div::_POST('search_field')) { // If any POST-vars are send, update the condition array $tmpl->tsbrowser_depthKeys = $tmpl->ext_getSearchKeys($theSetup, '', t3lib_div::_POST('search_field'), array()); } $menu = '<div class="tsob-menu"><label>' . $GLOBALS['LANG']->getLL('browse') . '</label>'; $menu .= t3lib_BEfunc::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 .= t3lib_BEfunc::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.xml:search') . '" />'; $menu .= t3lib_BEfunc::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); // Parser Errors: $pEkey = $bType == "setup" ? "config" : "constants"; if (count($tmpl->parserErrors[$pEkey])) { $errMsg = array(); foreach ($tmpl->parserErrors[$pEkey] as $inf) { $errMsg[] = $inf[1] . ": " . $inf[0]; } $theOutput .= $this->pObj->doc->spacer(10); $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', implode($errMsg, '<br />'), $GLOBALS['LANG']->getLL('errorsWarnings'), t3lib_FlashMessage::ERROR); $theOutput .= $flashMessage->render(); } if (isset($this->pObj->MOD_SETTINGS["ts_browser_TLKeys_" . $bType][$theKey])) { $remove = '<td width="1%" nowrap><a href="index.php?id=' . $this->pObj->id . '&addKey[' . $theKey . ']=0&SET[ts_browser_toplevel_' . $bType . ']=0"><strong>' . $GLOBALS['LANG']->getLL('removeKey') . '</strong></a></td>'; } 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 border="0" cellpadding="1" cellspacing="0" id="typo3-objectBrowser" width="100%"> <tr> <td><img src=clear.gif width=4 height=1></td> <td class="bgColor2"> <table border=0 cellpadding=0 cellspacing=0 class="bgColor5" width="100%"><tr class="t3-row-header"><td nowrap width="99%"><strong>' . $label . '</strong></td>' . $remove . '</tr></table> </td> </tr> <tr> <td><img src=clear.gif width=4 height=1></td> <td class="bgColor2"> <table border=0 cellpadding=0 cellspacing=0 class="bgColor4" width="100%"><tr><td nowrap>' . $tree . '</td></tr></table></td> </tr> </table> '; // second row options $menu = '<div class="tsob-menu-row2">'; $menu .= t3lib_BEfunc::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 .= t3lib_BEfunc::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 .= t3lib_BEfunc::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 .= t3lib_BEfunc::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 .= '<tr><td nowrap class="tsob-conditions"><input 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></td></tr>'; } $theOutput .= ' <table border="0" cellpadding="0" cellspacing="0" class="bgColor4">' . $out . ' <td><br /><input type="Submit" name="Submit" value="' . $GLOBALS['LANG']->getLL('setConditions') . '" /></td> </table> '; } // Ending section: $theOutput .= $this->pObj->doc->sectionEnd(); } return $theOutput; }
/** * Search (Full / Advanced) * * @return void */ function func_search() { global $LANG; $fullsearch = t3lib_div::makeInstance('t3lib_fullsearch'); $fullsearch->setFormName($this->formName); $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('search')); $this->content .= $this->doc->spacer(5); $menu2 = ''; if (!$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableTopMenu']) { $menu2 = t3lib_BEfunc::getFuncMenu(0, 'SET[search]', $this->MOD_SETTINGS['search'], $this->MOD_MENU['search']); } if ($this->MOD_SETTINGS['search'] == 'query' && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableTopMenu']) { $menu2 .= t3lib_BEfunc::getFuncMenu(0, 'SET[search_query_makeQuery]', $this->MOD_SETTINGS['search_query_makeQuery'], $this->MOD_MENU['search_query_makeQuery']) . '<br />'; } if (!$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableTopCheckboxes'] && $this->MOD_SETTINGS['search'] == 'query') { $menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[search_query_smallparts]', $this->MOD_SETTINGS['search_query_smallparts'], '', '', 'id="checkSearch_query_smallparts"') . ' <label for="checkSearch_query_smallparts">' . $GLOBALS['LANG']->getLL('showSQL') . '</label><br />'; $menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[search_result_labels]', $this->MOD_SETTINGS['search_result_labels'], '', '', 'id="checkSearch_result_labels"') . ' <label for="checkSearch_result_labels">' . $GLOBALS['LANG']->getLL('useFormattedStrings') . '</label><br />'; $menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[labels_noprefix]', $this->MOD_SETTINGS['labels_noprefix'], '', '', 'id="checkLabels_noprefix"') . ' <label for="checkLabels_noprefix">' . $GLOBALS['LANG']->getLL('dontUseOrigValues') . '</label><br />'; $menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[options_sortlabel]', $this->MOD_SETTINGS['options_sortlabel'], '', '', 'id="checkOptions_sortlabel"') . ' <label for="checkOptions_sortlabel">' . $GLOBALS['LANG']->getLL('sortOptions') . '</label><br />'; $menu2 .= t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[show_deleted]', $this->MOD_SETTINGS['show_deleted'], '', '', 'id="checkShow_deleted"') . ' <label for="checkShow_deleted">' . $GLOBALS['LANG']->getLL('showDeleted') . '</label>'; } $this->content .= $this->doc->section('', $menu2) . $this->doc->spacer(10); switch ($this->MOD_SETTINGS['search']) { case 'query': $this->content .= $fullsearch->queryMaker(); break; case 'raw': default: $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('searchOptions'), $fullsearch->form(), false, true); $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('result'), $fullsearch->search(), false, true); break; } }
/** * Checks if there are newer versions of installed extensions in the TER * integrated from the extension "ter_update_check" for TYPO3 4.2 by Christian Welzel * * @return nothing */ function checkForUpdates() { global $LANG; $content = ''; if (is_file(PATH_site . 'typo3temp/extensions.xml.gz')) { $content = $this->extensionList->showExtensionsToUpdate() . t3lib_BEfunc::getFuncCheck(0, 'SET[display_installed]', $this->MOD_SETTINGS['display_installed'], '', '', 'id="checkDisplayInstalled"') . ' <label for="checkDisplayInstalled">' . $LANG->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:display_nle') . '</label><br />' . t3lib_BEfunc::getFuncCheck(0, 'SET[display_files]', $this->MOD_SETTINGS['display_files'], '', '', 'id="checkDisplayFiles"') . ' <label for="checkDisplayFiles">' . $LANG->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:display_files') . '</label>'; $this->content .= $this->doc->section($LANG->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:header_upd_ext'), $content, 0, 1); $dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy']; $timeFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']; $content = sprintf($GLOBALS['LANG']->getLL('note_last_update_new'), date($dateFormat . ', ' . $timeFormat, filemtime(PATH_site . 'typo3temp/extensions.xml.gz'))) . '<br />'; } $content .= sprintf($GLOBALS['LANG']->getLL('note_last_update2_new'), '<a href="' . t3lib_div::linkThisScript(array('SET[function]' => 2)) . '">', '</a>'); $this->content .= $this->doc->section($LANG->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:header_vers_ret'), $content, 0, 1); }
/** * Rendering all other listings than QuickEdit * * @return void */ function renderListContent() { global $LANG, $BACK_PATH, $TCA; // Initialize list object (see "class.db_layout.inc"): $dblist = t3lib_div::makeInstance('tx_cms_layout'); $dblist->backPath = $BACK_PATH; $dblist->thumbs = $this->imagemode; $dblist->no_noWrap = 1; $dblist->descrTable = $this->descrTable; $this->pointer = t3lib_div::intInRange($this->pointer, 0, 100000); $dblist->script = 'db_layout.php'; $dblist->showIcon = 0; $dblist->setLMargin = 0; $dblist->doEdit = $this->EDIT_CONTENT; $dblist->ext_CALC_PERMS = $this->CALC_PERMS; $dblist->agePrefixes = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears'); $dblist->id = $this->id; $dblist->nextThree = t3lib_div::intInRange($this->modTSconfig['properties']['editFieldsAtATime'], 0, 10); $dblist->option_showBigButtons = $this->modTSconfig['properties']['disableBigButtons'] === '0'; $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!) $h_menu = $dblist->getTableMenu($this->id); // Initialize other variables: $h_func = ''; $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) { // Load full table definitions: t3lib_div::loadTCA($table); if (!isset($dblist->externalTables[$table])) { // Creating special conditions for each table: switch ($table) { case 'tt_board': $h_func = t3lib_BEfunc::getFuncMenu($this->id, 'SET[tt_board]', $this->MOD_SETTINGS['tt_board'], $this->MOD_MENU['tt_board'], 'db_layout.php', ''); break; case 'tt_address': $h_func = t3lib_BEfunc::getFuncMenu($this->id, 'SET[tt_address]', $this->MOD_SETTINGS['tt_address'], $this->MOD_MENU['tt_address'], 'db_layout.php', ''); break; case 'tt_links': $h_func = t3lib_BEfunc::getFuncMenu($this->id, 'SET[tt_links]', $this->MOD_SETTINGS['tt_links'], $this->MOD_MENU['tt_links'], 'db_layout.php', ''); break; case 'tt_calender': $h_func = t3lib_BEfunc::getFuncMenu($this->id, 'SET[tt_calender]', $this->MOD_SETTINGS['tt_calender'], $this->MOD_MENU['tt_calender'], 'db_layout.php', ''); break; case 'tt_products': $h_func = t3lib_BEfunc::getFuncMenu($this->id, 'SET[tt_products]', $this->MOD_SETTINGS['tt_products'], $this->MOD_MENU['tt_products'], 'db_layout.php', ''); break; case 'tt_guest': case 'tt_news': case 'fe_users': // Nothing break; case 'tt_content': $q_count = $this->getNumberOfHiddenElements(); $h_func_b = t3lib_BEfunc::getFuncCheck($this->id, 'SET[tt_content_showHidden]', $this->MOD_SETTINGS['tt_content_showHidden'], 'db_layout.php', '', 'id="checkTt_content_showHidden"') . '<label for="checkTt_content_showHidden">' . (!$q_count ? $GLOBALS['TBE_TEMPLATE']->dfw($LANG->getLL('hiddenCE')) : $LANG->getLL('hiddenCE') . ' (' . $q_count . ')') . '</label>'; $dblist->tt_contentConfig['showCommands'] = 1; // Boolean: Display up/down arrows and edit icons for tt_content records $dblist->tt_contentConfig['showInfo'] = 1; // Boolean: Display info-marks or not $dblist->tt_contentConfig['single'] = 0; // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page if ($this->MOD_SETTINGS['function'] == 4) { // grid view $dblist->tt_contentConfig['showAsGrid'] = 1; } // Setting up the tt_content columns to show: if (is_array($TCA['tt_content']['columns']['colPos']['config']['items'])) { $colList = array(); $tcaItems = t3lib_div::callUserFunction('EXT:cms/classes/class.tx_cms_backendlayout.php:tx_cms_BackendLayout->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 (strcmp($this->colPosList, '')) { $colList = array_intersect(t3lib_div::intExplode(',', $this->colPosList), $colList); } // If only one column found, display the single-column view. if (count($colList) === 1 && !$this->MOD_SETTINGS['function'] === 4) { $dblist->tt_contentConfig['single'] = 1; // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page $dblist->tt_contentConfig['showSingleCol'] = current($colList); // The column(s) to show if single mode (under each other) } $dblist->tt_contentConfig['cols'] = implode(',', $colList); // The order of the rows: Default is left(1), Normal(0), right(2), margin(3) $dblist->tt_contentConfig['showHidden'] = $this->MOD_SETTINGS['tt_content_showHidden']; $dblist->tt_contentConfig['sys_language_uid'] = intval($this->current_sys_language); // If the function menu is set to "Language": if ($this->MOD_SETTINGS['function'] == 2) { $dblist->tt_contentConfig['single'] = 0; $dblist->tt_contentConfig['languageMode'] = 1; $dblist->tt_contentConfig['languageCols'] = $this->MOD_MENU['language']; $dblist->tt_contentConfig['languageColsPointer'] = $this->current_sys_language; } break; } } else { if (isset($this->MOD_SETTINGS) && isset($this->MOD_MENU)) { $h_func = t3lib_BEfunc::getFuncMenu($this->id, 'SET[' . $table . ']', $this->MOD_SETTINGS[$table], $this->MOD_MENU[$table], 'db_layout.php', ''); } else { $h_func = ''; } } // 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->doc->getVersionSelector($this->id); // Generate the list of elements here: $dblist->generateList(); // Adding the list content to the tableOutput variable: $tableOutput[$table] = ($h_func ? $h_func . '<br /><img src="clear.gif" width="1" height="4" alt="" /><br />' : '') . $dblist->HTMLcode . ($h_func_b ? '<img src="clear.gif" width="1" height="10" alt="" /><br />' . $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 = ''; $h_func = ''; $h_func_b = ''; } // END: traverse tables // For Context Sensitive Menus: $this->doc->getContextMenuCode(); // Now, create listing based on which element is selected in the function menu: if ($this->MOD_SETTINGS['function'] == 3) { // Making page info: $content .= $this->doc->spacer(10); $content .= $this->doc->section($LANG->getLL('pageInformation'), $dblist->getPageInfoBox($this->pageinfo, $this->CALC_PERMS & 2), 0, 1); } else { // Add the content for each table we have rendered (traversing $tableOutput variable) foreach ($tableOutput as $table => $output) { $content .= $this->doc->section('<a name="' . $table . '"></a>' . $dblist->activeTables[$table], $output, TRUE, TRUE, 0, TRUE); $content .= $this->doc->spacer(15); $content .= $this->doc->sectionEnd(); } // Making search form: if (!$this->modTSconfig['properties']['disableSearchBox'] && count($tableOutput)) { $sectionTitle = t3lib_BEfunc::wrapInHelp('xMOD_csh_corebe', 'list_searchbox', $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.search', TRUE)); $content .= $this->doc->section($sectionTitle, $dblist->getSearchBox(0), FALSE, TRUE, FALSE, TRUE); } // Making display of Sys-notes (from extension "sys_note") $dblist->id = $this->id; $sysNotes = $dblist->showSysNotesForPage(); if ($sysNotes) { $content .= $this->doc->spacer(10); $content .= $this->doc->section($LANG->getLL('internalNotes'), $sysNotes, 0, 1); } // Add spacer in bottom of page: $content .= $this->doc->spacer(10); } // Ending page: $content .= $this->doc->spacer(10); return $content; }
function main() { // Initializes the module. Done in this function because we may need to re-initialize if data is submitted! global $SOBE, $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS; global $tmpl, $tplRow, $theConstants, $rootLine; // ************************** // 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"]; } // ************************** // Main // ************************** // BUGBUG: Should we check if the uset may at all read and write template-records??? $existTemplate = $this->initialize_editor($this->pObj->id, $template_uid); // initialize if ($existTemplate) { $theOutput .= $this->pObj->doc->divider(5); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('currentTemplate', true), t3lib_iconWorks::getSpriteIconForRecord('sys_template', $tplRow) . '<strong>' . $this->pObj->linkWrapTemplateTitle($tplRow["title"]) . '</strong>' . htmlspecialchars(trim($tplRow["sitetitle"]) ? ' - (' . $tplRow["sitetitle"] . ')' : '')); } if ($manyTemplatesMenu) { $theOutput .= $this->pObj->doc->section("", $manyTemplatesMenu); } // debug($tmpl->hierarchyInfo); $tmpl->clearList_const_temp = array_flip($tmpl->clearList_const); $tmpl->clearList_setup_temp = array_flip($tmpl->clearList_setup); $pointer = count($tmpl->hierarchyInfo); $tmpl->hierarchyInfoArr = $tmpl->ext_process_hierarchyInfo(array(), $pointer); $tmpl->processIncludes(); $hierarArr = array(); $head = '<tr class="t3-row-header">'; $head .= '<td>' . $GLOBALS['LANG']->getLL('title', true) . '</td>'; $head .= '<td>' . $GLOBALS['LANG']->getLL('rootlevel', true) . '</td>'; $head .= '<td>' . $GLOBALS['LANG']->getLL('clearSetup', true) . '</td>'; $head .= '<td>' . $GLOBALS['LANG']->getLL('clearConstants', true) . '</td>'; $head .= '<td>' . $GLOBALS['LANG']->getLL('pid', true) . '</td>'; $head .= '<td>' . $GLOBALS['LANG']->getLL('rootline', true) . '</td>'; $head .= '<td>' . $GLOBALS['LANG']->getLL('nextLevel', true) . '</td>'; $head .= '</tr>'; $hierar = implode(array_reverse($tmpl->ext_getTemplateHierarchyArr($tmpl->hierarchyInfoArr, "", array(), 1)), ""); $hierar = '<table id="ts-analyzer" border="0" cellpadding="0" cellspacing="1">' . $head . $hierar . '</table>'; $theOutput .= $this->pObj->doc->spacer(5); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('templateHierarchy', true), $hierar, 0, 1); $completeLink = '<p><a href="index.php?id=' . $GLOBALS['SOBE']->id . '&template=all">' . $GLOBALS['LANG']->getLL('viewCompleteTS', TRUE) . '</a></p>'; $theOutput .= $this->pObj->doc->spacer(5); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('completeTS', TRUE), $completeLink, 0, 1); // Output options $theOutput .= $this->pObj->doc->spacer(25); $theOutput .= $this->pObj->doc->divider(0); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('displayOptions', true), '', 1, 1); $addParams = t3lib_div::_GET('template') ? '&template=' . t3lib_div::_GET('template') : ''; $theOutput .= '<div class="tst-analyzer-options">' . t3lib_BEfunc::getFuncCheck($this->pObj->id, "SET[ts_analyzer_checkLinenum]", $this->pObj->MOD_SETTINGS["ts_analyzer_checkLinenum"], '', $addParams, 'id="checkTs_analyzer_checkLinenum"') . '<label for="checkTs_analyzer_checkLinenum">' . $GLOBALS['LANG']->getLL('lineNumbers', true) . '</label> ' . t3lib_BEfunc::getFuncCheck($this->pObj->id, "SET[ts_analyzer_checkSyntax]", $this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"], '', $addParams, 'id="checkTs_analyzer_checkSyntax"') . '<label for="checkTs_analyzer_checkSyntax">' . $GLOBALS['LANG']->getLL('syntaxHighlight', true) . '</label> ' . (!$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"] ? t3lib_BEfunc::getFuncCheck($this->pObj->id, "SET[ts_analyzer_checkComments]", $this->pObj->MOD_SETTINGS["ts_analyzer_checkComments"], '', $addParams, 'id="checkTs_analyzer_checkComments"') . '<label for="checkTs_analyzer_checkComments">' . $GLOBALS['LANG']->getLL('comments', true) . '</label> ' . t3lib_BEfunc::getFuncCheck($this->pObj->id, "SET[ts_analyzer_checkCrop]", $this->pObj->MOD_SETTINGS["ts_analyzer_checkCrop"], '', $addParams, 'id="checkTs_analyzer_checkCrop"') . '<label for="checkTs_analyzer_checkCrop">' . $GLOBALS['LANG']->getLL('cropLines', true) . '</label> ' : '') . '</div>'; // Output Constants if (t3lib_div::_GET('template')) { $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('constants', true), "", 0, 1); $theOutput .= $this->pObj->doc->sectionEnd(); $theOutput .= ' <table border="0" cellpadding="1" cellspacing="0"> '; $tmpl->ext_lineNumberOffset = -2; // Don't know why -2 and not 0... :-) But works. $tmpl->ext_lineNumberOffset_mode = "const"; $tmpl->ext_lineNumberOffset += count(explode(LF, t3lib_TSparser::checkIncludeLines("" . $GLOBALS["TYPO3_CONF_VARS"]["FE"]["defaultTypoScript_constants"]))) + 1; reset($tmpl->clearList_const); foreach ($tmpl->constants as $key => $val) { $cVal = current($tmpl->clearList_const); if ($cVal == t3lib_div::_GET('template') || t3lib_div::_GET('template') == 'all') { $theOutput .= ' <tr> <td><img src="clear.gif" width="3" height="1" alt="" /></td><td class="bgColor2"><strong>' . htmlspecialchars($tmpl->templateTitles[$cVal]) . '</strong></td></tr> <tr> <td><img src="clear.gif" width="3" height="1" alt="" /></td> <td class="bgColor2"><table border="0" cellpadding="0" cellspacing="0" class="bgColor0" width="100%"><tr><td nowrap="nowrap">' . $tmpl->ext_outputTS(array($val), $this->pObj->MOD_SETTINGS['ts_analyzer_checkLinenum'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkComments'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkCrop'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntax'], 0) . '</td></tr></table> </td> </tr> '; if (t3lib_div::_GET('template') != "all") { break; } } $tmpl->ext_lineNumberOffset += count(explode(LF, $val)) + 1; next($tmpl->clearList_const); } $theOutput .= ' </table> '; } // Output setup if (t3lib_div::_GET('template')) { $theOutput .= $this->pObj->doc->spacer(15); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('setup', true), "", 0, 1); $theOutput .= $this->pObj->doc->sectionEnd(); $theOutput .= ' <table border="0" cellpadding="1" cellspacing="0"> '; $tmpl->ext_lineNumberOffset = 0; $tmpl->ext_lineNumberOffset_mode = "setup"; $tmpl->ext_lineNumberOffset += count(explode(LF, t3lib_TSparser::checkIncludeLines("" . $GLOBALS["TYPO3_CONF_VARS"]["FE"]["defaultTypoScript_setup"]))) + 1; reset($tmpl->clearList_setup); foreach ($tmpl->config as $key => $val) { if (current($tmpl->clearList_setup) == t3lib_div::_GET('template') || t3lib_div::_GET('template') == 'all') { $theOutput .= ' <tr> <td><img src="clear.gif" width="3" height="1" alt="" /></td><td class="bgColor2"><strong>' . htmlspecialchars($tmpl->templateTitles[current($tmpl->clearList_setup)]) . '</strong></td></tr> <tr> <td><img src="clear.gif" width="3" height="1" alt="" /></td> <td class="bgColor2"><table border="0" cellpadding="0" cellspacing="0" class="bgColor0" width="100%"><tr><td nowrap="nowrap">' . $tmpl->ext_outputTS(array($val), $this->pObj->MOD_SETTINGS['ts_analyzer_checkLinenum'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkComments'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkCrop'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntax'], 0) . '</td></tr></table> </td> </tr> '; if (t3lib_div::_GET('template') != "all") { break; } } $tmpl->ext_lineNumberOffset += count(explode(LF, $val)) + 1; next($tmpl->clearList_setup); } $theOutput .= ' </table> '; } return $theOutput; }
/** * [Describe function...] * * @return [type] ... */ function main_rte() { global $LANG, $TYPO3_CONF_VARS, $FILEMOUNTS, $BE_USER; // Starting content: $this->content = $this->doc->startPage($LANG->getLL('Insert Image', 1)); // Making menu in top: $menuDef = array(); if (in_array('image', $this->allowedItems) && ($this->act == 'image' || t3lib_div::_GP('cWidth'))) { $menuDef['page']['isActive'] = $this->act == 'image'; $menuDef['page']['label'] = $LANG->getLL('currentImage', 1); $menuDef['page']['url'] = '#'; $menuDef['page']['addParams'] = 'onClick="jumpToUrl(\'?act=image&bparams=' . $this->bparams . '\');return false;"'; } if (in_array('magic', $this->allowedItems)) { $menuDef['file']['isActive'] = $this->act == 'magic'; $menuDef['file']['label'] = $LANG->getLL('magicImage', 1); $menuDef['file']['url'] = '#'; $menuDef['file']['addParams'] = 'onClick="jumpToUrl(\'?act=magic&bparams=' . $this->bparams . '\');return false;"'; } if (in_array('plain', $this->allowedItems)) { $menuDef['url']['isActive'] = $this->act == 'plain'; $menuDef['url']['label'] = $LANG->getLL('plainImage', 1); $menuDef['url']['url'] = '#'; $menuDef['url']['addParams'] = 'onClick="jumpToUrl(\'?act=plain&bparams=' . $this->bparams . '\');return false;"'; } if (in_array('dragdrop', $this->allowedItems)) { $menuDef['mail']['isActive'] = $this->act == 'dragdrop'; $menuDef['mail']['label'] = $LANG->getLL('dragDropImage', 1); $menuDef['mail']['url'] = '#'; $menuDef['mail']['addParams'] = 'onClick="jumpToUrl(\'?act=dragdrop&bparams=' . $this->bparams . '\');return false;"'; } // Call hook for extra options foreach ($this->hookObjects as $hookObject) { $menuDef = $hookObject->modifyMenuDefinition($menuDef); } $this->content .= $this->doc->getTabMenuRaw($menuDef); switch ($this->act) { case 'image': $JScode = ' document.write(printCurrentImageOptions()); insertImagePropertiesInForm();'; $this->content .= '<br />' . $this->doc->wrapScriptTags($JScode); break; case 'plain': case 'magic': // Adding upload form, if allowed $this->content .= $this->insertUploadForm($this->expandFolder); // Getting flag for showing/not showing thumbnails: $noThumbs = $BE_USER->getTSConfigVal('options.noThumbsInRTEimageSelect'); if (!$noThumbs) { // MENU-ITEMS, fetching the setting for thumbnails from File>List module: $_MOD_MENU = array('displayThumbs' => ''); $_MCONF['name'] = 'file_list'; $_MOD_SETTINGS = t3lib_BEfunc::getModuleData($_MOD_MENU, t3lib_div::_GP('SET'), $_MCONF['name']); $addParams = '&act=' . $this->act . '&editorNo=' . $this->editorNo . '&expandFolder=' . rawurlencode($this->expandFolder); $thumbNailCheck = t3lib_BEfunc::getFuncCheck('', 'SET[displayThumbs]', $_MOD_SETTINGS['displayThumbs'], 'select_image.php', $addParams, 'id="checkDisplayThumbs"') . ' <label for="checkDisplayThumbs">' . $LANG->sL('LLL:EXT:lang/locallang_mod_file_list.php:displayThumbs', 1) . '</label>'; } else { $thumbNailCheck = ''; } // Create folder tree: $foldertree = t3lib_div::makeInstance('tx_rtehtmlarea_image_folderTree'); $tree = $foldertree->getBrowsableTree(); list(, , $specUid) = explode('_', t3lib_div::_GP('PM')); $files = $this->expandFolder($foldertree->specUIDmap[$specUid], $this->act == 'plain', $noThumbs ? $noThumbs : !$_MOD_SETTINGS['displayThumbs']); $this->content .= '<table border="0" cellpadding="0" cellspacing="0"> <tr> <td style="vertical-align: top;">' . $this->barheader($LANG->getLL('folderTree') . ':') . $tree . '</td> <td> </td> <td style="vertical-align: top;">' . $files . '</td> </tr> </table> <br />' . $thumbNailCheck; // Add help message $helpMessage = $this->getHelpMessage($this->act); if ($helpMessage) { $this->content .= $this->getMsgBox($helpMessage); } break; case 'dragdrop': $foldertree = t3lib_div::makeInstance('TBE_FolderTree'); $foldertree->thisScript = $this->thisScript; $foldertree->ext_noTempRecyclerDirs = true; $tree = $foldertree->getBrowsableTree(); list(, , $specUid) = explode('_', t3lib_div::_GP('PM')); $files = $this->TBE_dragNDrop($foldertree->specUIDmap[$specUid], implode(',', $this->allowedFileTypes)); $this->content .= '<table border="0" cellpadding="0" cellspacing="0"> <tr> <td style="vertical-align: top;">' . $this->barheader($LANG->getLL('folderTree') . ':') . $tree . '</td> <td> </td> <td style="vertical-align: top;">' . $files . '</td> </tr> </table>'; break; default: // Call hook foreach ($this->hookObjects as $hookObject) { $this->content .= $hookObject->getTab($this->act); } break; } $this->content .= $this->doc->endPage(); $this->doc->JScodeArray['rtehtmlarea'] = $this->getJSCode($this->act, $this->editorNo, $this->sys_language_content); $this->content = $this->doc->insertStylesAndJS($this->content); return $this->content; }
/** * Main function of the module. Write the content to * * @return void */ public function main() { global $BE_USER, $LANG, $BACK_PATH, $TYPO3_CONF_VARS; // Get language to export/import $this->sysLanguage = $this->MOD_SETTINGS["lang"]; // Draw the header. $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $BACK_PATH; $this->doc->setModuleTemplate('EXT:l10nmgr/templates/cm1_template.html'); $this->doc->form = '<form action="" method="post" enctype="' . $TYPO3_CONF_VARS['SYS']['form_enctype'] . '">'; // JavaScript $this->doc->JScode = ' <script language="javascript" type="text/javascript"> script_ended = 0; function jumpToUrl(URL) { document.location = URL; } </script> <script language="javascript" type="text/javascript" src="' . t3lib_div::resolveBackPath($BACK_PATH . t3lib_extMgm::extRelPath('l10nmgr') . 'res/contrib/tabs.js') . '"></script> <link rel="stylesheet" type="text/css" href="' . t3lib_div::resolveBackPath($BACK_PATH . t3lib_extMgm::extRelPath('l10nmgr') . 'res/contrib/tabs.css') . '" />'; // Find l10n configuration record /** @var $l10ncfgObj tx_l10nmgr_l10nConfiguration */ $l10ncfgObj = t3lib_div::makeInstance('tx_l10nmgr_l10nConfiguration'); $l10ncfgObj->load($this->id); if ($l10ncfgObj->isLoaded()) { // Setting page id $this->id = $l10ncfgObj->getData('pid'); $this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; if ($this->id && $access) { // Header: // $this->content.=$this->doc->startPage($LANG->getLL('general.title')); // $this->content.=$this->doc->header($LANG->getLL('general.title')); // Create and render view to show details for the current l10nmgrcfg /** @var $l10nmgrconfigurationView tx_l10nmgr_l10ncfgDetailView */ $l10nmgrconfigurationView = t3lib_div::makeInstance('tx_l10nmgr_l10ncfgDetailView', $l10ncfgObj, $this->doc); $this->content .= $this->doc->section('', $l10nmgrconfigurationView->render()); $this->content .= $this->doc->divider(15); $this->content .= $this->doc->section($LANG->getLL('general.export.choose.action.title'), t3lib_BEfunc::getFuncMenu($l10ncfgObj->getId(), "SET[lang]", $this->sysLanguage, $this->MOD_MENU["lang"], '', '&srcPID=' . rawurlencode(t3lib_div::_GET('srcPID'))) . t3lib_BEfunc::getFuncMenu($l10ncfgObj->getId(), "SET[action]", $this->MOD_SETTINGS["action"], $this->MOD_MENU["action"], '', '&srcPID=' . rawurlencode(t3lib_div::_GET('srcPID'))) . t3lib_BEfunc::getFuncCheck($l10ncfgObj->getId(), "SET[onlyChangedContent]", $this->MOD_SETTINGS["onlyChangedContent"], '', '&srcPID=' . rawurlencode(t3lib_div::_GET('srcPID'))) . ' ' . $LANG->getLL('export.xml.new.title') . t3lib_BEfunc::getFuncCheck($l10ncfgObj->getId(), "SET[noHidden]", $this->MOD_SETTINGS["noHidden"], '', '&srcPID=' . rawurlencode(t3lib_div::_GET('srcPID'))) . ' ' . $LANG->getLL('export.xml.noHidden.title') . '</br>'); // Render content: if (!count($this->MOD_MENU['lang'])) { $this->content .= $this->doc->section('ERROR', $LANG->getLL('general.access.error.title')); } else { $this->moduleContent($l10ncfgObj); } } } $this->content .= $this->doc->spacer(10); $markers['CONTENT'] = $this->content; // Build the <body> for the module $docHeaderButtons = $this->getButtons(); $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('general.title')); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * [Describe function...] * * @return [type] ... */ function main() { global $LANG, $TYPO3_CONF_VARS, $FILEMOUNTS; $menu = ' <!-- Tab menu --> <div class="tabs"> <ul>'; $bgcolor = 'class=""'; $bgcolorA = 'class="current"'; if ($this->act == "image" || t3lib_div::_GP("cWidth")) { // If $this->act is specifically set to "image" or if cWidth is passed around... $menu .= '<td align=center nowrap="nowrap" width="25%"' . ($this->act == "image" ? $bgcolorA : $bgcolor) . '><a href="#" onclick="jumpToUrl(\'?act=image\');return false;"><strong>' . $LANG->getLL("currentImage") . '</strong></a></td>'; } if (in_array("magic", $this->allowedItems)) { $menu .= '<li ' . ($this->act == "magic" ? $bgcolorA : $bgcolor) . ' title="' . str_replace('"', "'", $LANG->getLL("magicImage_msg")) . '"><span><a href="#" onclick="jumpToUrl(\'?act=magic\');return false;">' . $LANG->getLL("magicImage") . '</a></span></li>' . "\n"; } if (in_array("plain", $this->allowedItems)) { $menu .= '<li ' . ($this->act == "plain" ? $bgcolorA : $bgcolor) . ' title="' . str_replace('"', "'", $LANG->getLL("plainImage_msg")) . '"><span><a href="#" onclick="jumpToUrl(\'?act=plain\');return false;">' . $LANG->getLL("plainImage") . '</a></span></li>' . "\n"; } $menu .= '<li ' . ($this->act == "upload" ? $bgcolorA : $bgcolor) . ' title="' . str_replace('"', "'", $LANG->getLL("uploadImage_msg")) . '"><span><a href="#" onclick="jumpToUrl(\'?act=upload\');return false;">' . $LANG->getLL("uploadImage") . '</a></span></li>' . "\n"; $menu .= ' </ul> </div>'; $this->content .= $menu; $this->content .= '<div class="panel_wrapper">'; if ($this->act != "upload") { // Getting flag for showing/not showing thumbnails: $noThumbs = $GLOBALS["BE_USER"]->getTSConfigVal("options.noThumbsInRTEimageSelect"); if (!$noThumbs) { // MENU-ITEMS, fetching the setting for thumbnails from File>List module: $_MOD_MENU = array('displayThumbs' => ''); $_MCONF['name'] = 'file_list'; $_MOD_SETTINGS = t3lib_BEfunc::getModuleData($_MOD_MENU, t3lib_div::_GP('SET'), $_MCONF['name']); $addParams = '&act=' . $this->act . '&expandFolder=' . rawurlencode($this->modData["expandFolder"]); $thumbNailCheck = '<fieldset><legend>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.php:displayThumbs', 1) . '</legend>' . t3lib_BEfunc::getFuncCheck('', 'SET[displayThumbs]', $_MOD_SETTINGS['displayThumbs'], 'rte_select_image.php', $addParams) . '</fieldset>'; } else { $thumbNailCheck = ''; } // File-folders: $foldertree = t3lib_div::makeInstance("localFolderTree"); $tree = $foldertree->getBrowsableTree(); list(, , $specUid) = explode("_", t3lib_div::_GP("PM")); $files = $this->expandFolder($foldertree->specUIDmap[$specUid], $this->act == "plain", $noThumbs ? $noThumbs : !$_MOD_SETTINGS['displayThumbs']); $files = '<fieldset><legend>' . $GLOBALS['LANG']->getLL('images') . '</legend><div style="overflow: hidden;"><table><tr><td>' . $files . '</td></tr></table></div></fieldset>'; $this->content .= '<table border="0" cellpadding="0" cellspacing="0" style="width: 100%;"> <tr> <td valign="top" style="width: 48%;"><fieldset><legend>' . $LANG->getLL("folderTree") . '</legend><div style="overflow: hidden;"><table><tr><td>' . $tree . '</td></tr></table></div></fieldset></td> <td valign="top" style="width: 1%;"><img src="clear.gif" width="5" alt="clear" /></td> <td valign="top" style="width: 48%;">' . $files . '</td> </tr> </table>' . $thumbNailCheck; } else { if ($this->act == "upload") { // *************************** // Upload // *************************** // File-folders: $foldertree = t3lib_div::makeInstance("localFolderTree"); $tree = $foldertree->getBrowsableTree(); $this->content .= '<table border="0" cellpadding="0" cellspacing="0" style="width: 100%;"> <tr> <td valign="top" style="width: 100%;"><fieldset><legend>' . $LANG->getLL("folderTree") . '</legend><div style="overflow: hidden;"><table><tr><td>' . $tree . '</td></tr></table></div></fieldset></td> </tr> </table>'; $fileProcessor = t3lib_div::makeInstance("t3lib_basicFileFunctions"); $fileProcessor->init($FILEMOUNTS, $TYPO3_CONF_VARS["BE"]["fileExtensions"]); $path = t3lib_div::_GP("expandFolder"); if (!$path || $path == "/" || !@is_dir($path)) { $path = $fileProcessor->findTempFolder(); // The closest TEMP-path is found if ($path) { $path .= "/"; } } if ($path && @is_dir($path)) { $this->content .= $this->uploadForm($path); } } else { $this->content .= '</div> <script language="javascript" type="text/javascript"> document.write(printCurrentImageOptions()); insertImagePropertiesInForm(); </script> '; } } $this->content .= '</div>'; }
/** * [Describe function...] * * @return [type] ... */ function main() { $arrayBrowser = t3lib_div::makeInstance('t3lib_arrayBrowser'); $this->content = $this->doc->header($GLOBALS['LANG']->getLL('configuration', true)); $this->content .= $this->doc->spacer(5); $this->content .= '<div id="lowlevel-config"> <label for="search_field">' . $GLOBALS['LANG']->getLL('enterSearchPhrase', true) . '</label> <input type="text" id="search_field" name="search_field" value="' . htmlspecialchars($search_field) . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(20) . ' /> <input type="submit" name="search" id="search" value="' . $GLOBALS['LANG']->getLL('search', true) . '" />'; $this->content .= t3lib_BEfunc::getFuncCheck(0, 'SET[regexsearch]', $this->MOD_SETTINGS['regexsearch'], '', '', 'id="checkRegexsearch"') . '<label for="checkRegexsearch">' . $GLOBALS['LANG']->getLL('useRegExp', true) . '</label>'; $this->content .= t3lib_BEfunc::getFuncCheck(0, 'SET[fixedLgd]', $this->MOD_SETTINGS['fixedLgd'], '', '', 'id="checkFixedLgd"') . '<label for="checkFixedLgd">' . $GLOBALS['LANG']->getLL('cropLines', true) . '</label> </div>'; $this->content .= $this->doc->spacer(5); switch ($this->MOD_SETTINGS['function']) { case 0: $theVar = $GLOBALS['TYPO3_CONF_VARS']; t3lib_div::naturalKeySortRecursive($theVar); $arrayBrowser->varName = '$TYPO3_CONF_VARS'; break; case 1: foreach ($GLOBALS['TCA'] as $table => $config) { t3lib_div::loadTCA($table); } $theVar = $GLOBALS['TCA']; t3lib_div::naturalKeySortRecursive($theVar); $arrayBrowser->varName = '$TCA'; break; case 2: $theVar = $GLOBALS['TCA_DESCR']; t3lib_div::naturalKeySortRecursive($theVar); $arrayBrowser->varName = '$TCA_DESCR'; break; case 3: $theVar = $GLOBALS['TYPO3_LOADED_EXT']; t3lib_div::naturalKeySortRecursive($theVar); $arrayBrowser->varName = '$TYPO3_LOADED_EXT'; break; case 4: $theVar = $GLOBALS['T3_SERVICES']; t3lib_div::naturalKeySortRecursive($theVar); $arrayBrowser->varName = '$T3_SERVICES'; break; case 5: $theVar = $GLOBALS['TBE_MODULES']; t3lib_div::naturalKeySortRecursive($theVar); $arrayBrowser->varName = '$TBE_MODULES'; break; case 6: $theVar = $GLOBALS['TBE_MODULES_EXT']; t3lib_div::naturalKeySortRecursive($theVar); $arrayBrowser->varName = '$TBE_MODULES_EXT'; break; case 7: $theVar = $GLOBALS['TBE_STYLES']; t3lib_div::naturalKeySortRecursive($theVar); $arrayBrowser->varName = '$TBE_STYLES'; break; case 8: $theVar = $GLOBALS['BE_USER']->uc; t3lib_div::naturalKeySortRecursive($theVar); $arrayBrowser->varName = '$BE_USER->uc'; break; case 9: $theVar = $GLOBALS['TYPO3_USER_SETTINGS']; t3lib_div::naturalKeySortRecursive($theVar); $arrayBrowser->varName = '$TYPO3_USER_SETTINGS'; break; default: $theVar = array(); break; } // Update node: $update = 0; $node = t3lib_div::_GET('node'); if (is_array($node)) { // If any plus-signs were clicked, it's registred. $this->MOD_SETTINGS['node_' . $this->MOD_SETTINGS['function']] = $arrayBrowser->depthKeys($node, $this->MOD_SETTINGS['node_' . $this->MOD_SETTINGS['function']]); $update = 1; } if ($update) { $GLOBALS['BE_USER']->pushModuleData($this->MCONF['name'], $this->MOD_SETTINGS); } $arrayBrowser->depthKeys = $this->MOD_SETTINGS['node_' . $this->MOD_SETTINGS['function']]; $arrayBrowser->regexMode = $this->MOD_SETTINGS['regexsearch']; $arrayBrowser->fixedLgd = $this->MOD_SETTINGS['fixedLgd']; $arrayBrowser->searchKeysToo = TRUE; $search_field = t3lib_div::_GP('search_field'); if (t3lib_div::_POST('search') && trim($search_field)) { // If any POST-vars are send, update the condition array $arrayBrowser->depthKeys = $arrayBrowser->getSearchKeys($theVar, '', $search_field, array()); } $tree = $arrayBrowser->tree($theVar, '', ''); $label = $this->MOD_MENU['function'][$this->MOD_SETTINGS['function']]; $this->content .= $this->doc->sectionEnd(); // Variable name: if (t3lib_div::_GP('varname')) { $line = t3lib_div::_GP('_') ? t3lib_div::_GP('_') : t3lib_div::_GP('varname'); if (t3lib_div::_GP('writetoexttables')) { // Write the line to extTables.php // change value to $GLOBALS $length = strpos($line, '['); $var = substr($line, 0, $length); $changedLine = '$GLOBALS[\'' . substr($line, 1, $length - 1) . '\']' . substr($line, $length); // insert line in extTables.php $extTables = t3lib_div::getURL(PATH_typo3conf . TYPO3_extTableDef_script); $extTables = '<?php' . preg_replace('/<\\?php|\\?>/is', '', $extTables) . $changedLine . LF . '?>'; $success = t3lib_div::writeFile(PATH_typo3conf . TYPO3_extTableDef_script, $extTables); if ($success) { // show flash message $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', '', sprintf($GLOBALS['LANG']->getLL('writeMessage', TRUE), TYPO3_extTableDef_script, '<br />', '<strong>' . $changedLine . '</strong>'), t3lib_FlashMessage::OK); } else { // Error: show flash message $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', '', sprintf($GLOBALS['LANG']->getLL('writeMessageFailed', TRUE), TYPO3_extTableDef_script), t3lib_FlashMessage::ERROR); } $this->content .= $flashMessage->render(); } $this->content .= '<div id="lowlevel-config-var"> <strong>' . $GLOBALS['LANG']->getLL('variable', TRUE) . '</strong><br /> <input type="text" name="_" value="' . trim(htmlspecialchars($line)) . '" size="120" /><br/>'; if (TYPO3_extTableDef_script !== '' && ($this->MOD_SETTINGS['function'] === '1' || $this->MOD_SETTINGS['function'] === '4')) { // write only for $TCA and TBE_STYLES if TYPO3_extTableDef_script is defined $this->content .= '<br /><input type="submit" name="writetoexttables" value="' . $GLOBALS['LANG']->getLL('writeValue', TRUE) . '" /></div>'; } else { $this->content .= $GLOBALS['LANG']->getLL('copyPaste', TRUE) . LF . '</div>'; } } $this->content .= '<br /><table border="0" cellpadding="0" cellspacing="0" class="t3-tree t3-tree-config">'; $this->content .= '<tr> <th class="t3-row-header t3-tree-config-header">' . $label . '</th> </tr> <tr> <td>' . $tree . '</td> </tr> </table> '; // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => $this->getFuncMenu(), '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('Configuration', $this->content); }
/** * The main processing method if this class * * @return string Information of the template status or the taken actions as HTML string */ function main() { global $SOBE, $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS; global $tmpl, $tplRow, $theConstants; $this->pObj->MOD_MENU['includeTypoScriptFileContent'] = true; $edit = $this->pObj->edit; $e = $this->pObj->e; t3lib_div::loadTCA('sys_template'); // ************************** // 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']; } // ************************** // Initialize // ************************** $existTemplate = $this->initialize_editor($this->pObj->id, $template_uid); // initialize if ($existTemplate) { $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid']; } // ************************** // Create extension template // ************************** $newId = $this->pObj->createTemplate($this->pObj->id, $saveId); if ($newId) { // switch to new template t3lib_utility_Http::redirect('index.php?id=' . $this->pObj->id . '&SET[templatesOnPage]=' . $newId); } if ($existTemplate) { // Update template ? $POST = t3lib_div::_POST(); if ($POST['submit'] || t3lib_div::testInt($POST['submit_x']) && t3lib_div::testInt($POST['submit_y']) || $POST['saveclose'] || t3lib_div::testInt($POST['saveclose_x']) && t3lib_div::testInt($POST['saveclose_y'])) { // Set the data to be saved $recData = array(); $alternativeFileName = array(); $resList = $tplRow['resources']; $tmp_upload_name = ''; $tmp_newresource_name = ''; // Set this to blank if (is_array($POST['data'])) { foreach ($POST['data'] as $field => $val) { switch ($field) { case 'constants': case 'config': case 'title': case 'sitetitle': case 'description': $recData['sys_template'][$saveId][$field] = $val; break; case 'resources': $tmp_upload_name = t3lib_div::upload_to_tempfile($_FILES['resources']['tmp_name']); // If there is an uploaded file, move it for the sake of safe_mode. if ($tmp_upload_name) { if ($tmp_upload_name != 'none' && $_FILES['resources']['name']) { $alternativeFileName[$tmp_upload_name] = trim($_FILES['resources']['name']); $resList = $tmp_upload_name . ',' . $resList; } } break; case 'new_resource': $newName = trim(t3lib_div::_GP('new_resource')); if ($newName) { $newName .= '.' . t3lib_div::_GP('new_resource_ext'); $tmp_newresource_name = t3lib_div::tempnam('new_resource_'); $alternativeFileName[$tmp_newresource_name] = $newName; $resList = $tmp_newresource_name . ',' . $resList; } break; case 'makecopy_resource': if (is_array($val)) { $resList = ',' . $resList . ','; foreach ($val as $k => $file) { $tmp_name = PATH_site . $TCA['sys_template']['columns']['resources']['config']['uploadfolder'] . '/' . $file; $resList = $tmp_name . ',' . $resList; } } break; case 'remove_resource': if (is_array($val)) { $resList = ',' . $resList . ','; foreach ($val as $k => $file) { $resList = str_replace(',' . $file . ',', ',', $resList); } } break; case 'totop_resource': if (is_array($val)) { $resList = ',' . $resList . ','; foreach ($val as $k => $file) { $resList = str_replace(',' . $file . ',', ',', $resList); $resList = ',' . $file . $resList; } } break; } } } $resList = implode(',', t3lib_div::trimExplode(',', $resList, 1)); if (strcmp($resList, $tplRow['resources'])) { $recData['sys_template'][$saveId]['resources'] = $resList; } if (count($recData)) { $recData['sys_template'][$saveId] = $this->processTemplateRowBeforeSaving($recData['sys_template'][$saveId]); // Create new tce-object $tce = t3lib_div::makeInstance('t3lib_TCEmain'); $tce->stripslashes_values = 0; $tce->alternativeFileName = $alternativeFileName; // 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'); // tce were processed successfully $this->tce_processed = true; // re-read the template ... $this->initialize_editor($this->pObj->id, $template_uid); } // Unlink any uploaded/new temp files there was: t3lib_div::unlink_tempfile($tmp_upload_name); t3lib_div::unlink_tempfile($tmp_newresource_name); // If files has been edited: if (is_array($edit)) { if ($edit['filename'] && $tplRow['resources'] && t3lib_div::inList($tplRow['resources'], $edit['filename'])) { // Check if there are resources, and that the file is in the resourcelist. $path = PATH_site . $TCA['sys_template']['columns']['resources']['config']['uploadfolder'] . '/' . $edit['filename']; $fI = t3lib_div::split_fileref($edit['filename']); if (@is_file($path) && t3lib_div::getFileAbsFileName($path) && t3lib_div::inList($this->pObj->textExtensions, $fI['fileext'])) { // checks that have already been done.. Just to make sure // @TODO: Check if the hardcorded value already has a config member, otherwise create one if (filesize($path) < 30720) { // checks that have already been done.. Just to make sure t3lib_div::writeFile($path, $edit['file']); $theOutput .= $this->pObj->doc->spacer(10); $theOutput .= $this->pObj->doc->section('<font color=red>' . $GLOBALS['LANG']->getLL('fileChanged') . '</font>', sprintf($GLOBALS['LANG']->getLL('resourceUpdated'), $edit['filename']), 0, 0, 0, 1); // Clear cache - the file has probably affected the template setup // @TODO: Check if the edited file really had something to do with cached data and prevent this clearing if possible! $tce = t3lib_div::makeInstance('t3lib_TCEmain'); $tce->stripslashes_values = 0; $tce->start(array(), array()); $tce->clear_cacheCmd('all'); } } } } } // hook Post updating template/TCE processing if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postTCEProcessingHook'])) { $postTCEProcessingHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postTCEProcessingHook']; if (is_array($postTCEProcessingHook)) { $hookParameters = array('POST' => $POST, 'tce' => $tce); foreach ($postTCEProcessingHook as $hookFunction) { t3lib_div::callUserFunction($hookFunction, $hookParameters, $this); } } } $theOutput .= $this->pObj->doc->spacer(5); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('templateInformation'), t3lib_iconWorks::getSpriteIconForRecord('sys_template', $tplRow) . '<strong>' . htmlspecialchars($tplRow['title']) . '</strong>' . htmlspecialchars(trim($tplRow['sitetitle']) ? ' - (' . $tplRow['sitetitle'] . ')' : ''), 0, 1); if ($manyTemplatesMenu) { $theOutput .= $this->pObj->doc->section('', $manyTemplatesMenu); $theOutput .= $this->pObj->doc->divider(5); } #$numberOfRows= t3lib_div::intInRange($this->pObj->MOD_SETTINGS["ts_template_editor_TArows"],0,150); #if (!$numberOfRows) $numberOfRows = 35; // If abort pressed, nothing should be edited: if ($POST['abort'] || t3lib_div::testInt($POST['abort_x']) && t3lib_div::testInt($POST['abort_y']) || $POST['saveclose'] || t3lib_div::testInt($POST['saveclose_x']) && t3lib_div::testInt($POST['saveclose_y'])) { unset($e); } if ($e['title']) { $outCode = '<input type="Text" name="data[title]" value="' . htmlspecialchars($tplRow['title']) . '"' . $this->pObj->doc->formWidth() . '>'; $outCode .= '<input type="Hidden" name="e[title]" value="1">'; $theOutput .= $this->pObj->doc->spacer(15); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('title'), $outCode); } if ($e['sitetitle']) { $outCode = '<input type="Text" name="data[sitetitle]" value="' . htmlspecialchars($tplRow['sitetitle']) . '"' . $this->pObj->doc->formWidth() . '>'; $outCode .= '<input type="Hidden" name="e[sitetitle]" value="1">'; $theOutput .= $this->pObj->doc->spacer(15); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('sitetitle'), $outCode); } if ($e['description']) { $outCode = '<textarea name="data[description]" rows="5" class="fixed-font enable-tab"' . $this->pObj->doc->formWidthText(48, '', '') . '>' . t3lib_div::formatForTextarea($tplRow['description']) . '</textarea>'; $outCode .= '<input type="Hidden" name="e[description]" value="1">'; $theOutput .= $this->pObj->doc->spacer(15); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('description'), $outCode); } if ($e['resources']) { // Upload $outCode = '<input type="File" name="resources"' . $this->pObj->doc->formWidth() . ' size="50">'; $outCode .= '<input type="Hidden" name="data[resources]" value="1">'; $outCode .= '<input type="Hidden" name="e[resources]" value="1">'; $outCode .= '<BR>' . $GLOBALS['LANG']->getLL('allowedExtensions') . ' <strong>' . $TCA['sys_template']['columns']['resources']['config']['allowed'] . '</strong>'; $outCode .= '<BR>' . $GLOBALS['LANG']->getLL('maxFilesize') . ' <strong>' . t3lib_div::formatSize($TCA['sys_template']['columns']['resources']['config']['max_size'] * 1024) . '</strong>'; $theOutput .= $this->pObj->doc->spacer(15); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('uploadResource'), $outCode); // New $opt = explode(',', $this->pObj->textExtensions); $optTags = ''; foreach ($opt as $extVal) { $optTags .= '<option value="' . $extVal . '">.' . $extVal . '</option>'; } $outCode = '<input type="text" name="new_resource"' . $this->pObj->doc->formWidth(20) . '> <select name="new_resource_ext">' . $optTags . '</select>'; $outCode .= '<input type="Hidden" name="data[new_resource]" value="1">'; $theOutput .= $this->pObj->doc->spacer(15); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('newTextResource'), $outCode); // Make copy $rL = $this->resourceListForCopy($this->pObj->id, $template_uid); if ($rL) { $theOutput .= $this->pObj->doc->spacer(20); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('copyResource'), $rL); } // Update resource list $rL = $this->procesResources($tplRow['resources'], 1); if ($rL) { $theOutput .= $this->pObj->doc->spacer(20); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('updateResourceList'), $rL); } } if ($e['constants']) { $outCode = '<textarea name="data[constants]" rows="' . $numberOfRows . '" wrap="off" class="fixed-font enable-tab"' . $this->pObj->doc->formWidthText(48, 'width:98%;height:70%', 'off') . ' class="fixed-font">' . t3lib_div::formatForTextarea($tplRow['constants']) . '</textarea>'; $outCode .= '<input type="Hidden" name="e[constants]" value="1">'; // Display "Include TypoScript file content?" checkbox $outCode .= t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[includeTypoScriptFileContent]', $this->pObj->MOD_SETTINGS['includeTypoScriptFileContent'], 'index.php', '&e[constants]=1', 'id="checkIncludeTypoScriptFileContent"'); $outCode .= '<label for="checkIncludeTypoScriptFileContent">' . $GLOBALS['LANG']->getLL('includeTypoScriptFileContent') . '</label><br />'; $theOutput .= $this->pObj->doc->spacer(15); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('constants'), ''); $theOutput .= $this->pObj->doc->sectionEnd() . $outCode; } if ($e['file']) { $path = PATH_site . $TCA['sys_template']['columns']['resources']['config']['uploadfolder'] . '/' . $e[file]; $fI = t3lib_div::split_fileref($e[file]); if (@is_file($path) && t3lib_div::inList($this->pObj->textExtensions, $fI['fileext'])) { if (filesize($path) < $TCA['sys_template']['columns']['resources']['config']['max_size'] * 1024) { $fileContent = t3lib_div::getUrl($path); $outCode = $GLOBALS['LANG']->getLL('file') . ' <strong>' . $e[file] . '</strong><BR>'; $outCode .= '<textarea name="edit[file]" rows="' . $numberOfRows . '" wrap="off" class="fixed-font enable-tab"' . $this->pObj->doc->formWidthText(48, 'width:98%;height:70%', 'off') . ' class="fixed-font">' . t3lib_div::formatForTextarea($fileContent) . '</textarea>'; $outCode .= '<input type="Hidden" name="edit[filename]" value="' . $e[file] . '">'; $outCode .= '<input type="Hidden" name="e[file]" value="' . htmlspecialchars($e[file]) . '">'; $theOutput .= $this->pObj->doc->spacer(15); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('editResource'), ''); $theOutput .= $this->pObj->doc->sectionEnd() . $outCode; } else { $theOutput .= $this->pObj->doc->spacer(15); $fileToBig = sprintf($GLOBALS['LANG']->getLL('filesizeExceeded'), $TCA['sys_template']['columns']['resources']['config']['max_size']); $filesizeNotAllowed = sprintf($GLOBALS['LANG']->getLL('notAllowed'), $TCA['sys_template']['columns']['resources']['config']['max_size']); $theOutput .= $this->pObj->doc->section('<font color=red>' . $fileToBig . '</font>', $filesizeNotAllowed, 0, 0, 0, 1); } } } if ($e['config']) { $outCode = '<textarea name="data[config]" rows="' . $numberOfRows . '" wrap="off" class="fixed-font enable-tab"' . $this->pObj->doc->formWidthText(48, "width:98%;height:70%", "off") . ' class="fixed-font">' . t3lib_div::formatForTextarea($tplRow["config"]) . '</textarea>'; $outCode .= '<input type="Hidden" name="e[config]" value="1">'; // Display "Include TypoScript file content?" checkbox $outCode .= t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[includeTypoScriptFileContent]', $this->pObj->MOD_SETTINGS['includeTypoScriptFileContent'], 'index.php', '&e[config]=1', 'id="checkIncludeTypoScriptFileContent"'); $outCode .= '<label for="checkIncludeTypoScriptFileContent">' . $GLOBALS['LANG']->getLL('includeTypoScriptFileContent') . '</label><br />'; if (t3lib_extMgm::isLoaded('tsconfig_help')) { $url = $BACK_PATH . 'wizard_tsconfig.php?mode=tsref'; $params = array('formName' => 'editForm', 'itemName' => 'data[config]'); $outCode .= '<a href="#" onClick="vHWin=window.open(\'' . $url . t3lib_div::implodeArrayForUrl('', array('P' => $params)) . '\',\'popUp' . $md5ID . '\',\'height=500,width=780,status=0,menubar=0,scrollbars=1\');vHWin.focus();return false;">' . t3lib_iconWorks::getSpriteIcon('actions-system-typoscript-documentation-open', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:tsRef', true))) . '</a>'; } $theOutput .= $this->pObj->doc->spacer(15); $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('setup'), ''); $theOutput .= $this->pObj->doc->sectionEnd() . $outCode; } // Processing: $outCode = ''; $outCode .= $this->tableRow($GLOBALS['LANG']->getLL('title'), htmlspecialchars($tplRow['title']), 'title'); $outCode .= $this->tableRow($GLOBALS['LANG']->getLL('sitetitle'), htmlspecialchars($tplRow['sitetitle']), 'sitetitle'); $outCode .= $this->tableRow($GLOBALS['LANG']->getLL('description'), nl2br(htmlspecialchars($tplRow['description'])), 'description'); $outCode .= $this->tableRow($GLOBALS['LANG']->getLL('resources'), $this->procesResources($tplRow['resources']), 'resources'); $outCode .= $this->tableRow($GLOBALS['LANG']->getLL('constants'), sprintf($GLOBALS['LANG']->getLL('editToView'), trim($tplRow[constants]) ? count(explode(LF, $tplRow[constants])) : 0), 'constants'); $outCode .= $this->tableRow($GLOBALS['LANG']->getLL('setup'), sprintf($GLOBALS['LANG']->getLL('editToView'), trim($tplRow[config]) ? count(explode(LF, $tplRow[config])) : 0), 'config'); $outCode = '<br /><br /><table class="t3-table-info">' . $outCode . '</table>'; // Edit all icon: $outCode .= '<br /><a href="#" onClick="' . t3lib_BEfunc::editOnClick(rawurlencode('&createExtension=0') . '&edit[sys_template][' . $tplRow['uid'] . ']=edit', $BACK_PATH, '') . '"><strong>' . t3lib_iconWorks::getSpriteIcon('actions-document-open', array('title' => $GLOBALS['LANG']->getLL('editTemplateRecord'))) . $GLOBALS['LANG']->getLL('editTemplateRecord') . '</strong></a>'; $theOutput .= $this->pObj->doc->section('', $outCode); // hook after compiling the output if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postOutputProcessingHook'])) { $postOutputProcessingHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postOutputProcessingHook']; if (is_array($postOutputProcessingHook)) { $hookParameters = array('theOutput' => &$theOutput, 'POST' => $POST, 'e' => $e, 'tplRow' => $tplRow, 'numberOfRows' => $numberOfRows); foreach ($postOutputProcessingHook as $hookFunction) { t3lib_div::callUserFunction($hookFunction, $hookParameters, $this); } } } } else { $theOutput .= $this->pObj->noTemplate(1); } return $theOutput; }
/** * TYPO3 Element Browser: Showing a folder tree, allowing you to browse for files. * * @return string HTML content for the module */ function main_file() { global $BE_USER; // Starting content: $content .= $this->doc->startPage('TBE file selector'); // Init variable: $pArr = explode('|', $this->bparams); // Create upload/create folder forms, if a path is given: $path = $this->expandFolder; if (!$path || !@is_dir($path)) { // The closest TEMP-path is found $path = $this->fileProcessor->findTempFolder() . '/'; } if ($path != '/' && @is_dir($path)) { $uploadForm = $this->uploadForm($path); $createFolder = $this->createFolder($path); } else { $createFolder = ''; $uploadForm = ''; } if ($BE_USER->getTSConfigVal('options.uploadFieldsInTopOfEB')) { $content .= $uploadForm; } // Getting flag for showing/not showing thumbnails: $noThumbs = $GLOBALS['BE_USER']->getTSConfigVal('options.noThumbsInEB'); if (!$noThumbs) { // MENU-ITEMS, fetching the setting for thumbnails from File>List module: $_MOD_MENU = array('displayThumbs' => ''); $_MCONF['name'] = 'file_list'; $_MOD_SETTINGS = t3lib_BEfunc::getModuleData($_MOD_MENU, t3lib_div::_GP('SET'), $_MCONF['name']); $addParams = '&act=' . $this->act . '&mode=' . $this->mode . '&expandFolder=' . rawurlencode($path) . '&bparams=' . rawurlencode($this->bparams); $thumbNailCheck = t3lib_BEfunc::getFuncCheck('', 'SET[displayThumbs]', $_MOD_SETTINGS['displayThumbs'], $this->thisScript, $addParams, 'id="checkDisplayThumbs"') . ' <label for="checkDisplayThumbs">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.php:displayThumbs', 1) . '</label>'; } else { $thumbNailCheck = ''; } $noThumbs = $noThumbs ? $noThumbs : !$_MOD_SETTINGS['displayThumbs']; // Create folder tree: $foldertree = t3lib_div::makeInstance('TBE_FolderTree'); $foldertree->thisScript = $this->thisScript; $foldertree->ext_noTempRecyclerDirs = $this->mode == 'filedrag'; $tree = $foldertree->getBrowsableTree(); list(, , $specUid) = explode('_', $this->PM); if ($this->mode == 'filedrag') { $files = $this->TBE_dragNDrop($foldertree->specUIDmap[$specUid], $pArr[3]); } else { $files = $this->TBE_expandFolder($foldertree->specUIDmap[$specUid], $pArr[3], $noThumbs); } // Putting the parts together, side by side: $content .= ' <!-- Wrapper table for folder tree / file list: --> <table border="0" cellpadding="0" cellspacing="0" id="typo3-EBfiles"> <tr> <td class="c-wCell" valign="top">' . $this->barheader($GLOBALS['LANG']->getLL('folderTree') . ':') . $tree . '</td> <td class="c-wCell" valign="top">' . $files . '</td> </tr> </table> '; $content .= $thumbNailCheck; // Adding create folder + upload forms if applicable: if (!$BE_USER->getTSConfigVal('options.uploadFieldsInTopOfEB')) { $content .= $uploadForm; } if ($BE_USER->isAdmin() || $BE_USER->getTSConfigVal('options.createFoldersInEB')) { $content .= $createFolder; } // Add some space $content .= '<br /><br />'; // Setup indexed elements: $this->doc->JScode .= $this->doc->wrapScriptTags('BrowseLinks.addElements(' . json_encode($this->elements) . ');'); // Ending page, returning content: $content .= $this->doc->endPage(); $content = $this->doc->insertStylesAndJS($content); return $content; }
/** * Main function * * @return void */ function main() { global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS; $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('adminLog')); $this->content .= $this->doc->spacer(5); // Menu compiled: $menuU = t3lib_BEfunc::getFuncMenu(0, 'SET[users]', $this->MOD_SETTINGS['users'], $this->MOD_MENU['users']); $menuM = t3lib_BEfunc::getFuncMenu(0, 'SET[max]', $this->MOD_SETTINGS['max'], $this->MOD_MENU['max']); $menuT = t3lib_BEfunc::getFuncMenu(0, 'SET[time]', $this->MOD_SETTINGS['time'], $this->MOD_MENU['time']); $menuA = t3lib_BEfunc::getFuncMenu(0, 'SET[action]', $this->MOD_SETTINGS['action'], $this->MOD_MENU['action']); $menuW = t3lib_BEfunc::getFuncMenu(0, 'SET[workspaces]', $this->MOD_SETTINGS['workspaces'], $this->MOD_MENU['workspaces']); $groupByPage = t3lib_BEfunc::getFuncCheck(0, 'SET[groupByPage]', $this->MOD_SETTINGS['groupByPage']); $style = ' style="margin:4px 2px;padding:1px;vertical-align:middle;width: 115px;"'; $inputDate = '<input type="text" value="' . ($this->MOD_SETTINGS['manualdate'] ? $this->MOD_SETTINGS['manualdate'] : '') . '" name="SET[manualdate]" id="tceforms-datetimefield-manualdate"' . $style . ' />'; $pickerInputDate = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/datepicker.gif', '', 0) . ' style="cursor:pointer; vertical-align:middle;" alt=""' . ' id="picker-tceforms-datetimefield-manualdate" />'; $inputDate_end = '<input type="text" value="' . ($this->MOD_SETTINGS['manualdate_end'] ? $this->MOD_SETTINGS['manualdate_end'] : '') . '" name="SET[manualdate]" id="tceforms-datetimefield-manualdate_end"' . $style . ' />'; $pickerInputDate_end = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/datepicker.gif', '', 0) . ' style="cursor:pointer; vertical-align:middle;" alt=""' . ' id="picker-tceforms-datetimefield-manualdate_end" />'; $setButton = '<input type="button" value="' . $GLOBALS['LANG']->getLL('set') . '" onclick="jumpToUrl(\'mod.php?&id=0&M=tools_log&SET[manualdate]=\'+escape($(\'tceforms-datetimefield-manualdate\').value)+\'&SET[manualdate_end]=\'+escape($(\'tceforms-datetimefield-manualdate_end\').value),this);" />'; $this->content .= $this->doc->section('', $this->doc->menuTable(array(array($GLOBALS['LANG']->getLL('users'), $menuU), array($GLOBALS['LANG']->getLL('time'), $menuT . ($this->MOD_SETTINGS['time'] == 30 ? '<br />' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:from', true) . ' ' . $inputDate . $pickerInputDate . ' ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:to', true) . ' ' . $inputDate_end . $pickerInputDate_end . ' ' . $setButton : ''))), array(array($GLOBALS['LANG']->getLL('max'), $menuM), array($GLOBALS['LANG']->getLL('action'), $menuA)), array($GLOBALS['BE_USER']->workspace !== 0 ? array($GLOBALS['LANG']->getLL('workspace'), '<strong>' . $GLOBALS['BE_USER']->workspace . '</strong>') : array($GLOBALS['LANG']->getLL('workspace'), $menuW), array($GLOBALS['LANG']->getLL('groupByPage'), $groupByPage)))); $codeArr = $this->lF->initArray(); $oldHeader = ''; $c = 0; // Action (type): $where_part = ''; if ($this->MOD_SETTINGS['action'] > 0) { $where_part .= ' AND type=' . intval($this->MOD_SETTINGS['action']); } elseif ($this->MOD_SETTINGS['action'] == -1) { $where_part .= ' AND error != 0'; } $starttime = 0; $endtime = $GLOBALS['EXEC_TIME']; // Time: switch ($this->MOD_SETTINGS['time']) { case 0: // This week $week = (date('w') ? date('w') : 7) - 1; $starttime = mktime(0, 0, 0) - $week * 3600 * 24; break; case 1: // Last week $week = (date('w') ? date('w') : 7) - 1; $starttime = mktime(0, 0, 0) - ($week + 7) * 3600 * 24; $endtime = mktime(0, 0, 0) - $week * 3600 * 24; break; case 2: // Last 7 days $starttime = mktime(0, 0, 0) - 7 * 3600 * 24; break; case 10: // This month $starttime = mktime(0, 0, 0, date('m'), 1); break; case 11: // Last month $starttime = mktime(0, 0, 0, date('m') - 1, 1); $endtime = mktime(0, 0, 0, date('m'), 1); break; case 12: // Last 31 days $starttime = mktime(0, 0, 0) - 31 * 3600 * 24; break; case 30: $starttime = $this->theTime; if ($this->theTime_end) { $endtime = $this->theTime_end; } else { $endtime = $GLOBALS['EXEC_TIME']; } } if ($starttime) { $where_part .= ' AND tstamp>=' . $starttime . ' AND tstamp<' . $endtime; } // Users $selectUsers = array(); if (substr($this->MOD_SETTINGS['users'], 0, 3) == "gr-") { // All users $this->be_user_Array = t3lib_BEfunc::blindUserNames($this->be_user_Array, array(substr($this->MOD_SETTINGS['users'], 3)), 1); if (is_array($this->be_user_Array)) { foreach ($this->be_user_Array as $val) { if ($val['uid'] != $BE_USER->user['uid']) { $selectUsers[] = $val['uid']; } } } $selectUsers[] = 0; $where_part .= ' AND userid in (' . implode($selectUsers, ',') . ')'; } elseif (substr($this->MOD_SETTINGS['users'], 0, 3) == "us-") { // All users $selectUsers[] = intval(substr($this->MOD_SETTINGS['users'], 3)); $where_part .= ' AND userid in (' . implode($selectUsers, ',') . ')'; } elseif ($this->MOD_SETTINGS['users'] == -1) { $where_part .= ' AND userid=' . $BE_USER->user['uid']; // Self user } // Workspace if ($GLOBALS['BE_USER']->workspace !== 0) { $where_part .= ' AND workspace=' . intval($GLOBALS['BE_USER']->workspace); } elseif ($this->MOD_SETTINGS['workspaces'] != -99) { $where_part .= ' AND workspace=' . intval($this->MOD_SETTINGS['workspaces']); } // Finding out which page ids are in the log: $logPids = array(); if ($this->MOD_SETTINGS['groupByPage']) { $log = $GLOBALS['TYPO3_DB']->exec_SELECTquery('event_pid', 'sys_log', '1=1' . $where_part, 'event_pid'); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($log)) { $logPids[] = $row['event_pid']; } // Overview: $overviewList = array(); foreach ($logPids as $pid) { if ((int) $pid > 0) { $overviewList[] = htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('pagenameWithUID'), t3lib_BEfunc::getRecordPath($pid, '', 20), $pid)); } } sort($overviewList); $this->content .= $this->doc->divider(5); $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('overview'), sprintf($GLOBALS['LANG']->getLL('timeInfo'), date($this->dateFormat, $starttime), date($this->dateFormat, $endtime)) . '<br /><br /><br />' . implode('<br />', $overviewList), 1, 1, 0); $this->content .= $this->doc->spacer(30); } else { $logPids[] = '_SINGLE'; } foreach ($logPids as $pid) { $codeArr = $this->lF->initArray(); $this->lF->reset(); $oldHeader = ''; $this->content .= $this->doc->divider(5); switch ($pid) { case '_SINGLE': $insertMsg = ''; break; case '-1': $insertMsg = ' ' . $GLOBALS['LANG']->getLL('forNonPageRelatedActions') . ' '; break; case '0': $insertMsg = ' ' . $GLOBALS['LANG']->getLL('forRootLevel') . ' '; break; default: $insertMsg = ' ' . sprintf($GLOBALS['LANG']->getLL('forPage'), t3lib_BEfunc::getRecordPath($pid, '', 20), $pid) . ' '; break; } $this->content .= $this->doc->section(sprintf($GLOBALS['LANG']->getLL('logForNonPageRelatedActionsOrRootLevelOrPage'), $insertMsg, date($this->dateFormat, $starttime), date($this->dateFormat, $endtime)), '', 1, 1, 0); $log = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_log', '1=1' . $where_part . ($pid != '_SINGLE' ? ' AND event_pid=' . intval($pid) : ''), '', 'uid DESC', intval($this->MOD_SETTINGS['max'])); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($log)) { $header = $this->doc->formatTime($row['tstamp'], 10); if (!$oldHeader) { $oldHeader = $header; } if ($header != $oldHeader) { $this->content .= $this->doc->spacer(10); $this->content .= $this->doc->section($oldHeader, $this->doc->table($codeArr)); $codeArr = $this->lF->initArray(); $oldHeader = $header; $this->lF->reset(); } $i++; $codeArr[$i][] = $this->lF->getTimeLabel($row['tstamp']); $codeArr[$i][] = $this->lF->getUserLabel($row['userid'], $row['workspace']); $codeArr[$i][] = $this->lF->getTypeLabel($row['type']); $codeArr[$i][] = $row['error'] ? $this->lF->getErrorFormatting($this->lF->errorSign[$row['error']], $row['error']) : ''; $codeArr[$i][] = $this->lF->getActionLabel($row['type'] . '_' . $row['action']); $codeArr[$i][] = $this->lF->formatDetailsForList($row); } $this->content .= $this->doc->spacer(10); $this->content .= $this->doc->section($header, $this->doc->table($codeArr)); $GLOBALS['TYPO3_DB']->sql_free_result($log); } // 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->startPage($GLOBALS['LANG']->getLL('adminLog')); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Add options * * @param string $type Option type: html, funcCheck, funcMenu, funcInput * @param string $paramName Name of the MOD_MENU/MOD_SETTINGS parameter * @param string $description Description as plain text or as HTML for html type * @param array $items for funcMenu * @return void */ function addOption($type, $paramName, $description, $items = array()) { $this->develAvailableOptions[$paramName] = $description; if (!$this->config_checkValueEnabled('options.' . $paramName, true)) { return; } $id = 'l' . uniqid('tx_dam_scbase'); $idAttr = ' id="' . $id . '"'; $descriptionLabel = htmlspecialchars($description); $descriptionLabel = '<label for="' . $id . '">' . $descriptionLabel . '</label>'; switch ($type) { case 'funcCheck': $this->modOptions[$paramName] = t3lib_BEfunc::getFuncCheck($this->addParams, 'SET[' . $paramName . ']', $this->MOD_SETTINGS[$paramName]) . ' ' . $descriptionLabel; $this->modOptions[$paramName] = str_replace('<input', '<input' . $idAttr, $this->modOptions[$paramName]); break; case 'funcInput': $this->modOptions[$paramName] = $descriptionLabel . ' ' . t3lib_BEfunc::getFuncInput($this->addParams, 'SET[' . $paramName . ']', $this->MOD_SETTINGS[$paramName]); $this->modOptions[$paramName] = str_replace('<input', '<input' . $idAttr, $this->modOptions[$paramName]); break; case 'funcMenu': $this->modOptions[$paramName] = $descriptionLabel . ' ' . t3lib_BEfunc::getFuncMenu($this->addParams, 'SET[' . $paramName . ']', $this->MOD_SETTINGS[$paramName], $items); $this->modOptions[$paramName] = str_replace('<select', '<select' . $idAttr, $this->modOptions[$paramName]); break; case 'html': $this->modOptions[$paramName] = $description; break; } }
/** * Rendering the content for the publish and review panel in the workspace manager * * @return string HTML content */ function moduleContent_publish() { global $LANG; // Initialize: $content = ''; $details = t3lib_div::_GP('details'); // Create additional menus: $menu = ''; if ($GLOBALS['BE_USER']->workspace === 0) { $menu .= t3lib_BEfunc::getFuncMenu(0, 'SET[filter]', $this->MOD_SETTINGS['filter'], $this->MOD_MENU['filter']); $menu .= t3lib_BEfunc::getFuncMenu(0, 'SET[display]', $this->MOD_SETTINGS['display'], $this->MOD_MENU['display']); } $menu .= t3lib_BEfunc::getFuncMenu(0, 'SET[diff]', $this->MOD_SETTINGS['diff'], $this->MOD_MENU['diff']); if ($GLOBALS['BE_USER']->workspace !== 0) { $menu .= t3lib_BEfunc::getFuncCheck(0, 'SET[expandSubElements]', $this->MOD_SETTINGS['expandSubElements'], '', '', 'id="checkExpandSubElements"') . ' <label for="checkExpandSubElements">' . $LANG->getLL('label_showsubelements') . '</label> '; } // Create header: $title = ''; $description = ''; switch ($GLOBALS['BE_USER']->workspace) { case 0: $title = t3lib_iconWorks::getIconImage('sys_workspace', array(), $this->doc->backPath, ' align="top"') . '[' . $LANG->getLL('shortcut_onlineWS') . ']'; $description = $LANG->getLL('workspace_description_live'); break; case -1: $title = t3lib_iconWorks::getIconImage('sys_workspace', array(), $this->doc->backPath, ' align="top"') . '[' . $LANG->getLL('shortcut_offlineWS') . ']'; $description = $LANG->getLL('workspace_description_draft'); break; case -99: $title = $this->doc->icons(3) . '[' . $LANG->getLL('shortcut_noWSfound') . ']'; $description = $LANG->getLL('workspace_description_no_access'); break; default: $title = t3lib_iconWorks::getIconImage('sys_workspace', $GLOBALS['BE_USER']->workspaceRec, $this->doc->backPath, ' align="top"') . '[' . $GLOBALS['BE_USER']->workspace . '] ' . t3lib_BEfunc::getRecordTitle('sys_workspace', $GLOBALS['BE_USER']->workspaceRec, TRUE); $description = $GLOBALS['BE_USER']->workspaceRec['description'] ? htmlspecialchars($GLOBALS['BE_USER']->workspaceRec['description']) : '<em>[' . $LANG->getLL('shortcut_noWSfound') . ']</em>'; break; } // Buttons for publish / swap: $actionLinks = ''; if ($GLOBALS['BE_USER']->workspace !== 0) { if ($this->publishAccess) { $confirmation = $LANG->JScharCode($LANG->getLL($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1 ? 'submit_publish_workspace_confirmation_1' : 'submit_publish_workspace_confirmation_2')); $actionLinks .= '<input type="submit" name="_publish" value="' . $LANG->getLL('submit_publish_workspace') . '" onclick="if (confirm(' . $confirmation . ')) window.location.href=\'publish.php?swap=0\';return false"/>'; if ($GLOBALS['BE_USER']->workspaceSwapAccess()) { $confirmation = $LANG->JScharCode($LANG->getLL($GLOBALS['BE_USER']->workspaceRec['publish_access'] & 1 ? 'submit_swap_workspace_confirmation_1' : 'submit_swap_workspace_confirmation_2')); $actionLinks .= '<input type="submit" name="_swap" value="' . $LANG->getLL('submit_swap_workspace') . '" onclick="if (confirm(' . $confirmation . ')) window.location.href=\'publish.php?swap=1\';return false ;" />'; } } else { $actionLinks .= $this->doc->icons(1) . $LANG->getLL('no_publish_permission'); } // Preview of workspace link if (t3lib_div::_POST('_previewLink')) { $ttlHours = intval($GLOBALS['BE_USER']->getTSConfigVal('options.workspaces.previewLinkTTLHours')); $ttlHours = $ttlHours ? $ttlHours : 24 * 2; $previewUrl = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'index.php?ADMCMD_prev=' . t3lib_BEfunc::compilePreviewKeyword('', $GLOBALS['BE_USER']->user['uid'], 60 * 60 * $ttlHours, $GLOBALS['BE_USER']->workspace) . '&id=' . intval($GLOBALS['BE_USER']->workspaceRec['db_mountpoints']); $actionLinks .= '<br />Any user can browse the workspace frontend using this link for the next ' . $ttlHours . ' hours (does not require backend login):<br /><br /><a target="_blank" href="' . htmlspecialchars($previewUrl) . '">' . $previewUrl . '</a>'; } else { $actionLinks .= '<input type="submit" name="_previewLink" value="Generate Workspace Preview Link" />'; } } $wsAccess = $GLOBALS['BE_USER']->checkWorkspace($GLOBALS['BE_USER']->workspaceRec); // Add header to content variable: $content = ' <table border="0" cellpadding="0" cellspacing="0" id="t3-user-ws-wsinfotable" class="t3-table t3-table-info"> <tr> <td class="t3-col-header" nowrap="nowrap">' . $LANG->getLL('label_workspace') . ' </th> <td nowrap="nowrap">' . $title . '</td> </tr> <tr> <td class="t3-col-header" nowrap="nowrap">' . $LANG->getLL('label_description') . ' </td> <td>' . $description . '</td> </tr>' . ($GLOBALS['BE_USER']->workspace != -99 && !$details ? ' <tr> <td class="t3-col-header" nowrap="nowrap">' . $LANG->getLL('label_options') . ' </td> <td>' . $menu . $actionLinks . '</td> </tr> <tr> <td class="t3-col-header" nowrap="nowrap">' . $LANG->getLL('label_status') . ' </td> <td>' . $LANG->getLL('label_access_level') . ' ' . $GLOBALS['LANG']->getLL('workspace_list_access_' . $wsAccess['_ACCESS']) . '</td> </tr>' : '') . ' </table> <br /> '; // Add publishing and review overview: if ($GLOBALS['BE_USER']->workspace != -99) { if ($details) { $content .= $this->displayVersionDetails($details); } else { $content .= $this->displayWorkspaceOverview(); } $content .= '<br />'; } // Return content: return $content; }
/** * Create HTML checkbox to enable/disable thumbnail display * * @return string HTML code */ function addDisplayOptions() { global $BE_USER; // Getting flag for showing/not showing thumbnails: $noThumbs = $BE_USER->getTSConfigVal('options.noThumbsInEB') || $this->mode == 'rte' && $BE_USER->getTSConfigVal('options.noThumbsInRTEimageSelect') || $this->act == 'dragdrop'; if ($noThumbs) { $thumbNailCheckbox = ''; } else { $thumbNailCheckbox = t3lib_BEfunc::getFuncCheck('', 'SET[displayThumbs]', $this->displayThumbs(), $this->thisScript, t3lib_div::implodeArrayForUrl('', $this->addParams)); $description = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:displayThumbs', 1); $id = 'l' . uniqid('tx_dam_scbase'); $idAttr = ' id="' . $id . '"'; $thumbNailCheckbox = str_replace('<input', '<input' . $idAttr, $thumbNailCheckbox); $thumbNailCheckbox .= ' <label for="' . $id . '">' . $description . '</label>'; $this->damSC->addOption('html', 'thumbnailCheckbox', $thumbNailCheckbox); } $this->damSC->addOption('funcCheck', 'extendedInfo', $GLOBALS['LANG']->getLL('displayExtendedInfo', 1)); }
/** * Renders the "advanced functions" sidebar item. * * @param object &$pObj: Reference to the page object (the templavoila page module) * @return string HTML output * @access public */ function renderItem_advancedFunctions(&$pObj) { global $LANG; $tableRows = array (' <tr class="bgColor4-20"> <th colspan="3"> </th> </tr> '); // Render checkbox for showing hidden elements: $tableRows[] = ' <tr class="bgColor4"> <td width="20"> '. t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'advancedfunctions_showhiddenelements', $this->doc->backPath) .' </td><td width="200"> ' . $LANG->getLL('sidebar_advancedfunctions_labelshowhidden', 1) . ': </td> <td>' . t3lib_BEfunc::getFuncCheck($pObj->id, 'SET[tt_content_showHidden]', $pObj->MOD_SETTINGS['tt_content_showHidden'] !== '0', '', '') . '</td> </tr> '; // Render checkbox for showing outline: if ($GLOBALS['BE_USER']->isAdmin() || $this->pObj->modTSconfig['properties']['enableOutlineForNonAdmin']) { $tableRows[] = ' <tr class="bgColor4"> <td width="20"> '. t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'advancedfunctions_showoutline', $this->doc->backPath) .' </td><td width="200"> ' . $LANG->getLL('sidebar_advancedfunctions_labelshowoutline', 1) . ': </td> <td>'.t3lib_BEfunc::getFuncCheck($pObj->id,'SET[showOutline]',$pObj->MOD_SETTINGS['showOutline'],'','').'</td> </tr> '; } return (count ($tableRows)) ? '<table border="0" cellpadding="0" cellspacing="1" class="lrPadding" width="100%">'.implode ('', $tableRows).'</table>' : ''; }
/** * Main method of the module * * @return HTML */ function main() { // Initializes the module. Done in this function because we may need to re-initialize if data is submitted! global $SOBE, $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS; $theOutput .= $this->pObj->doc->spacer(5); $theOutput .= $this->pObj->doc->section($LANG->getLL("title"), "Dummy content here...", 0, 1); $menu = array(); $menu[] = t3lib_BEfunc::getFuncCheck($this->wizard->pObj->id, "SET[tx_languagevisibility_modfunc1_check]", $this->wizard->pObj->MOD_SETTINGS["tx_languagevisibility_modfunc1_check"]) . $LANG->getLL("checklabel"); $theOutput .= $this->pObj->doc->spacer(5); $theOutput .= $this->pObj->doc->section("Menu", implode(" - ", $menu), 0, 1); return $theOutput; }
/** * [Describe function...] * * @return [type] ... */ function renderListCheckBoxes() { $show = array(); if (is_array($this->TSprop['list.']['show.'])) { $show = $this->TSprop['list.']['show.']; } $allowedCbNames = array(); if (t3lib_div::inList($this->fieldList, 'image')) { $allowedCbNames[] = 'showThumbs'; } if (!$this->isAdmin) { $allowedCbNames[] = 'showOnlyEditable'; } $params = $this->getLinkParams(); $out = array(); foreach ($allowedCbNames as $n) { if ((bool) $show['cb_' . $n]) { $out[] = '<span class="list-cb">' . t3lib_BEfunc::getFuncCheck($params, 'SET[' . $n . ']', $this->MOD_SETTINGS[$n], '', '', 'id="cb-' . $n . '"') . ' <label for="cb-' . $n . '">' . $GLOBALS['LANG']->getLL($n, 1) . '</label></span>'; } } $content = '<div>' . implode('', $out) . '</div>'; return $content; }
/** * Renders the "advanced functions" sidebar item. * * @param object &$pObj: Reference to the page object (the templavoila page module) * @return string HTML output * @access public */ function renderItem_advancedFunctions(&$pObj) { global $LANG; $tableRows = array(' <tr class="bgColor4-20"> <th colspan="2"> </th> </tr> '); // Render checkbox for showing hidden elements: $tableRows[] = ' <tr class="bgColor4"> <td width="1%" nowrap="nowrap"> ' . t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'advancedfunctions_showhiddenelements', $this->doc->backPath) . ' ' . $LANG->getLL('sidebar_advancedfunctions_labelshowhidden', 1) . ': </td> <td>' . t3lib_BEfunc::getFuncCheck($pObj->id, 'SET[tt_content_showHidden]', $pObj->MOD_SETTINGS['tt_content_showHidden'], '', '') . '</td> </tr> '; // Render checkbox for showing outline: if ($GLOBALS['BE_USER']->isAdmin()) { $tableRows[] = ' <tr class="bgColor4"> <td width="1%" nowrap="nowrap"> ' . t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'advancedfunctions_showoutline', $this->doc->backPath) . ' ' . $LANG->getLL('sidebar_advancedfunctions_labelshowoutline', 1) . ' :</td> <td>' . t3lib_BEfunc::getFuncCheck($pObj->id, 'SET[showOutline]', $pObj->MOD_SETTINGS['showOutline'], '', '') . '</td> </tr> '; } // Render cache menu: if ($pObj->id > 0) { $cacheMenu = $this->doc->clearCacheMenu(intval($pObj->id), FALSE); if ($cacheMenu != '') { // Show cache functions only if they are available to the user $cshItem = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'TCEforms_cacheSelector', $GLOBALS['BACK_PATH'], '', TRUE); $tableRows[] = ' <tr class="bgColor4"> <td nowrap="nowrap">' . $cshItem . ' ' . $LANG->getLL('sidebar_advancedfunctions_labelcachefunctions', 1) . ':</td> <td>' . $cacheMenu . '</td> </tr> '; } } return count($tableRows) ? '<table border="0" cellpadding="0" cellspacing="1" class="lrPadding" width="100%">' . implode('', $tableRows) . '</table>' : ''; }
/** * Renders module content main view: * * @return void */ function renderModuleContent_mainView() { global $LANG; // Traverse scopes of data structures display template records belonging to them: // Each scope is places in its own tab in the tab menu: $dsScopes = array( tx_templavoila_datastructure::SCOPE_PAGE, tx_templavoila_datastructure::SCOPE_FCE, tx_templavoila_datastructure::SCOPE_UNKNOWN ); $toIdArray = $parts = array(); foreach($dsScopes as $scopePointer) { // Create listing for a DS: list($content,$dsCount,$toCount,$toIdArrayTmp) = $this->renderDSlisting($scopePointer); $toIdArray = array_merge($toIdArrayTmp, $toIdArray); $scopeIcon = ''; // Label for the tab: switch((string)$scopePointer) { case tx_templavoila_datastructure::SCOPE_PAGE: $label = $LANG->getLL('pagetemplates'); $scopeIcon = t3lib_iconWorks::getSpriteIconForRecord('pages', array()); break; case tx_templavoila_datastructure::SCOPE_FCE: $label = $LANG->getLL('fces'); $scopeIcon = t3lib_iconWorks::getSpriteIconForRecord('tt_content', array()); break; case tx_templavoila_datastructure::SCOPE_UNKNOWN: $label = $LANG->getLL('other'); break; default: $label = sprintf($LANG->getLL('unknown'), $scopePointer); break; } // Error/Warning log: $errStat = $this->getErrorLog($scopePointer); // Add parts for Tab menu: $parts[] = array( 'label' => $label, 'icon' => $scopeIcon, 'content' => $content, 'linkTitle' => 'DS/TO = '.$dsCount.'/'.$toCount, 'stateIcon' => $errStat['iconCode'] ); } // Find lost Template Objects and add them to a TAB if any are found: $lostTOs = ''; $lostTOCount = 0; $toRepo = t3lib_div::makeInstance('tx_templavoila_templateRepository'); $toList = $toRepo->getAll($this->id); foreach($toList as $toObj) { if(!in_array($toObj->getKey(), $toIdArray)) { $rTODres = $this->renderTODisplay($toObj, -1, 1); $lostTOs.= $rTODres['HTML']; $lostTOCount++; } } if ($lostTOs) { // Add parts for Tab menu: $parts[] = array( 'label' => sprintf($LANG->getLL('losttos', 1), $lostTOCount), 'content' => $lostTOs ); } // Complete Template File List $parts[] = array( 'label' => $LANG->getLL('templatefiles', 1), 'content' => $this->completeTemplateFileList() ); // Errors: if (false !== ($errStat = $this->getErrorLog('_ALL'))) { $parts[] = array( 'label' => 'Errors ('.$errStat['count'].')', 'content' => $errStat['content'], 'stateIcon' => $errStat['iconCode'] ); } $showDetails = sprintf(' <label for="set_details">%s</label> ', $LANG->getLL('showdetails', 1)); $showUnused = sprintf(' <label for="set_details">%s</label> ', $LANG->getLL('showuused', 1)); // Create setting handlers: $settings = '<p>' . t3lib_BEfunc::getFuncCheck('', 'SET[set_details]', $this->MOD_SETTINGS['set_details'], '', t3lib_div::implodeArrayForUrl('', $_GET, '', 1, 1), 'id="set_details"') . $showDetails . t3lib_BEfunc::getFuncCheck('', 'SET[set_unusedDs]', $this->MOD_SETTINGS['set_unusedDs'], '', t3lib_div::implodeArrayForUrl('', $_GET, '', 1, 1), 'id="set_unusedDs"') . $showUnused . '</p>'; // Add output: $this->content.=$this->doc->section($LANG->getLL('title'), $settings. $this->doc->getDynTabMenu($parts,'TEMPLAVOILA:templateOverviewModule:'.$this->id, 0,0,300) ,0,1); }
/** * Main function of class * * @return string HTML output */ function main() { global $LANG; $menu = t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[tsconf_parts]', $this->pObj->MOD_SETTINGS['tsconf_parts'], $this->pObj->MOD_MENU['tsconf_parts']); $menu .= '<br /><label for="checkTsconf_alphaSort">' . $GLOBALS['LANG']->getLL('sort_alphabetic', true) . '</label> ' . t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[tsconf_alphaSort]', $this->pObj->MOD_SETTINGS['tsconf_alphaSort'], '', '', 'id="checkTsconf_alphaSort"'); $menu .= '<br /><br />'; if ($this->pObj->MOD_SETTINGS['tsconf_parts'] == 99) { $TSparts = t3lib_BEfunc::getPagesTSconfig($this->pObj->id, '', 1); $lines = array(); $pUids = array(); foreach ($TSparts as $k => $v) { if ($k != 'uid_0') { if ($k == 'defaultPageTSconfig') { $pTitle = '<strong>' . $GLOBALS['LANG']->getLL('editTSconfig_default', 1) . '</strong>'; $editIcon = ''; } else { $pUids[] = substr($k, 4); $row = t3lib_BEfunc::getRecordWSOL('pages', substr($k, 4)); $pTitle = $this->pObj->doc->getHeader('pages', $row, '', 0); $editIdList = substr($k, 4); $params = '&edit[pages][' . $editIdList . ']=edit&columnsOnly=TSconfig'; $onclickUrl = t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], ''); $editIcon = '<a href="#" onclick="' . htmlspecialchars($onclickUrl) . '" title="' . $GLOBALS['LANG']->getLL('editTSconfig', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>'; } $TScontent = nl2br(htmlspecialchars(trim($v) . chr(10))); $tsparser = t3lib_div::makeInstance('t3lib_TSparser'); $tsparser->lineNumberOffset = 0; $TScontent = $tsparser->doSyntaxHighlight(trim($v) . LF, '', 0); $lines[] = ' <tr><td nowrap="nowrap" class="bgColor5">' . $pTitle . '</td></tr> <tr><td nowrap="nowrap" class="bgColor4">' . $TScontent . $editIcon . '</td></tr> <tr><td> </td></tr> '; } } if (count($pUids)) { $params = '&edit[pages][' . implode(',', $pUids) . ']=edit&columnsOnly=TSconfig'; $onclickUrl = t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], ''); $editIcon = '<a href="#" onclick="' . htmlspecialchars($onclickUrl) . '" title="' . $GLOBALS['LANG']->getLL('editTSconfig_all', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '<strong>' . $GLOBALS['LANG']->getLL('editTSconfig_all', 1) . '</strong>' . '</a>'; } else { $editIcon = ''; } $theOutput .= $this->pObj->doc->section($LANG->getLL('tsconf_title'), t3lib_BEfunc::cshItem('_MOD_' . $GLOBALS['MCONF']['name'], 'tsconfig_edit', $GLOBALS['BACK_PATH'], '|<br />') . $menu . ' <br /><br /> <!-- Edit fields: --> <table border="0" cellpadding="0" cellspacing="1">' . implode('', $lines) . '</table><br />' . $editIcon, 0, 1); } else { $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext'); // Defined global here! $tmpl->tt_track = 0; // Do not log time-performance information $tmpl->fixedLgd = 0; $tmpl->linkObjects = 0; $tmpl->bType = ''; $tmpl->ext_expandAllNotes = 1; $tmpl->ext_noPMicons = 1; switch ($this->pObj->MOD_SETTINGS['tsconf_parts']) { case '1': $modTSconfig = t3lib_BEfunc::getModTSconfig($this->pObj->id, 'mod'); break; case '1a': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_layout', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1b': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_view', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1c': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_modules', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1d': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_list', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1e': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_info', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1f': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_func', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '1g': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_ts', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '2': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '5': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TCEFORM', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '6': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TCEMAIN', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '3': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TSFE', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; case '4': $modTSconfig = $GLOBALS['BE_USER']->getTSConfig('user', t3lib_BEfunc::getPagesTSconfig($this->pObj->id)); break; default: $modTSconfig['properties'] = t3lib_BEfunc::getPagesTSconfig($this->pObj->id); break; } $modTSconfig = $modTSconfig['properties']; if (!is_array($modTSconfig)) { $modTSconfig = array(); } $theOutput .= $this->pObj->doc->section($LANG->getLL('tsconf_title'), t3lib_BEfunc::cshItem('_MOD_' . $GLOBALS['MCONF']['name'], 'tsconfig_hierarchy', $GLOBALS['BACK_PATH'], '|<br />') . $menu . ' <!-- Page TSconfig Tree: --> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td nowrap="nowrap">' . $tmpl->ext_getObjTree($modTSconfig, '', '', '', '', $this->pObj->MOD_SETTINGS['tsconf_alphaSort']) . '</td> </tr> </table>', 0, 1); } // Return output: return $theOutput; }
/** * MAIN function for cache information * * @return string Output HTML for the module. */ function main() { $content = ''; // specific language selection from form $depth = $this->pObj->MOD_SETTINGS['depth']; $langOnly = $this->pObj->MOD_SETTINGS['lang']; if ($langOnly != '' && $langOnly != '-1') { $this->langOnly = intval($langOnly); } $id = intval($this->pObj->id); if ($id) { // Add CSS $this->pObj->content = str_replace('/*###POSTCSSMARKER###*/', ' TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; } TABLE#tx-seobasics TD { vertical-align: top; } ', $this->pObj->content); // Add Javascript $this->pObj->doc->JScode .= '<script type="text/javascript" src="' . $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath($this->extKey) . 'modfunc1/js/mootools.v1.11.js"></script>'; $this->pObj->doc->JScode .= '<script type="text/javascript" src="' . $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath($this->extKey) . 'modfunc1/js/seobasics.js"></script>'; // render depth selector $content = t3lib_BEfunc::getFuncMenu($id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php'); // if there are multiple languages, show dropdown to narrow it down. if ($this->sysHasLangs) { $content .= 'Display only language: '; $content .= t3lib_BEfunc::getFuncMenu($id, 'SET[lang]', $this->pObj->MOD_SETTINGS['lang'], $this->pObj->MOD_MENU['lang'], 'index.php') . '<br/>'; } $content .= t3lib_BEfunc::getFuncCheck($id, 'SET[hideShortcuts]', $this->pObj->MOD_SETTINGS['hideShortcuts'], 'index.php', '', 'id="SET[hideShortcuts]"'); $content .= '<label for="SET[hideShortcuts]">Hide Shortcuts</label> '; $content .= t3lib_BEfunc::getFuncCheck($id, 'SET[hideDisabled]', $this->pObj->MOD_SETTINGS['hideDisabled'], 'index.php', '', 'id="SET[hideDisabled]"'); $content .= '<label for="SET[hideDisabled]">Hide Disabled Pages</label> <br/>'; $content .= t3lib_BEfunc::getFuncCheck($id, 'SET[hideSysFolders]', $this->pObj->MOD_SETTINGS['hideSysFolders'], 'index.php', '', 'id="SET[hideSysFolders]"'); $content .= '<label for="SET[hideSysfolders]">Hide System Folders</label> <br/>'; $content .= t3lib_BEfunc::getFuncCheck($id, 'SET[hideNotInMenu]', $this->pObj->MOD_SETTINGS['hideNotInMenu'], 'index.php', '', 'id="SET[hideNotInMenu]"'); $content .= '<label for="SET[hideNotInMenu]">Hide Not in menu</label> <br/>'; // Save previous editing when submit was hit $this->saveChanges(); // == Showing the tree == // Initialize starting point (= $id) of page tree: $treeStartingRecord = t3lib_BEfunc::getRecord('pages', $id); t3lib_BEfunc::workspaceOL('pages', $treeStartingRecord); // Initialize tree object: $tree = t3lib_div::makeInstance('t3lib_pageTree'); $tree->addField('tx_seo_titletag', 1); $tree->addField('keywords', 1); $tree->addField('description', 1); if (t3lib_extMgm::isLoaded('realurl')) { $tree->addField('tx_realurl_pathsegment', 1); } $tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1)); // Creating top icon; the current page $HTML = t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'], 'align="top"'); $tree->tree[] = array('row' => $treeStartingRecord, 'HTML' => $HTML); // Create the tree from starting point if ($depth > 0) { $tree->getTree($id, $depth, ''); } // get all page IDs that will be displayed $pages = array(); foreach ($tree->tree as $row) { $pages[] = $row['row']['uid']; } // load language overlays and path cache for all pages shown $uidList = $GLOBALS['TYPO3_DB']->cleanIntList(implode(',', $pages)); $this->loadLanguageOverlays($uidList); if (t3lib_extMgm::isLoaded('realurl')) { $this->loadPathCache($uidList); } // Render information table $content .= $this->renderSaveButtons(); $content .= $this->renderSEOTable($tree); $content .= $this->renderSaveButtons(); } return $content; }