/** * Displays the edit page screen if the currently selected page is of the doktype "Sysfolder" * * @param array $pageRecord: The current page record * @return mixed HTML output from this submodule or FALSE if this submodule doesn't feel responsible * @access public */ function renderDoktype_254($pageRecord) { global $LANG, $BE_USER, $TYPO3_CONF_VARS; // Prepare the record icon including a content sensitive menu link wrapped around it: $pageTitle = htmlspecialchars(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle('pages', $pageRecord), 50)); $recordIcon = t3lib_iconWorks::getSpriteIconForRecord('pages', $pageRecord); $iconEdit = t3lib_iconWorks::getSpriteIcon('actions-document-open', array('title' => htmlspecialchars($LANG->sL('LLL:EXT:lang/locallang_mod_web_list.xml:editPage')))); $editButton = $this->pObj->link_edit($iconEdit, 'pages', $pageRecord['uid']); if ($this->userHasAccessToListModule()) { if (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000) { $listModuleURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . 'db_list.php?id=' . intval($this->pObj->id); } else { $listModuleURL = t3lib_BEfunc::getModuleUrl('web_list', array('id' => intval($this->pObj->id)), ''); } $onClick = "top.nextLoadModuleUrl='" . $listModuleURL . "';top.fsMod.recentIds['web']=" . intval($this->pObj->id) . ";top.goToModule('web_list',1);"; $listModuleLink = '<br /><br />' . t3lib_iconWorks::getSpriteIcon('actions-system-list-open') . '<strong><a href="#" onClick="' . $onClick . '">' . $LANG->getLL('editpage_sysfolder_switchtolistview', '', 1) . '</a></strong> '; } else { $listModuleLink = $LANG->getLL('editpage_sysfolder_listview_noaccess', '', 1); } $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', $LANG->getLL('editpage_sysfolder_intro', '', 1), '', t3lib_FlashMessage::INFO); $content = $flashMessage->render() . $listModuleLink; return $content; }
/** * Rendering the table select menu: * * @return string HTML */ function renderTableMenu() { // Create menu options: $opt = array(); $opt[] = ' <option value=""></option>'; foreach ($GLOBALS['TCA'] as $tableName => $cfg) { $opt[] = ' <option value="' . htmlspecialchars($tableName) . '"' . ($this->tableName == $tableName ? ' selected="selected"' : '') . '>' . htmlspecialchars($GLOBALS['LANG']->sL($cfg['ctrl']['title'])) . '</option>'; } // Compile selector box menu: $content = ' <p><strong>Select table:</strong></p> <select onchange="' . htmlspecialchars('document.location = \'' . t3lib_BEfunc::getModuleUrl('tools_txextdevevalM1') . '&tableName=\'+this.options[this.selectedIndex].value') . '"> ' . implode('', $opt) . ' </select> <hr /> '; // Return selector box menu: return $content; }
/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @param string Identifier for function of module * @return array all available buttons as an assoc. array */ protected function getDocHeaderButtons() { global $TCA, $LANG, $BACK_PATH, $BE_USER; $buttons = array('csh' => '', 'view' => '', 'history_page' => '', 'move_page' => '', 'move_record' => '', 'new_page' => '', 'edit_page' => '', 'record_list' => '', 'shortcut' => '', 'cache' => ''); // View page $viewAddGetVars = $this->currentLanguageUid ? '&L=' . $this->currentLanguageUid : ''; $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->id, $BACK_PATH, t3lib_BEfunc::BEgetRootLine($this->id), '', '', $viewAddGetVars)) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1))) . '</a>'; // Shortcut if ($BE_USER->mayMakeShortcut()) { $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']); } // If access to Web>List for user, then link to that module. if ($BE_USER->check('modules', 'web_list')) { if (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000) { $href = $GLOBALS['BACK_PATH'] . 'db_list.php?id=' . $this->id . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')); } else { $href = t3lib_BEfunc::getModuleUrl('web_list', array('id' => $this->id, 'returnUrl' => t3lib_div::getIndpEnv('REQUEST_URI'))); } $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-list-open', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1))) . '</a>'; } if (!$this->modTSconfig['properties']['disableIconToolbar']) { // Page history $buttons['history_page'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(\'' . $BACK_PATH . 'show_rechis.php?element=' . rawurlencode('pages:' . $this->id) . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . '#latest\');return false;') . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-history-open', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:recordHistory', 1))) . '</a>'; if (!$this->translatorMode && $GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'new')) { // Create new page (wizard) $buttons['new_page'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(\'' . $BACK_PATH . 'db_new.php?id=' . $this->id . '&pagesOnly=1&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI') . '&updatePageTree=true') . '\');return false;') . '">' . t3lib_iconWorks::getSpriteIcon('actions-page-new', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:newPage', 1))) . '</a>'; } if (!$this->translatorMode && $GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'edit')) { // Edit page properties $params = '&edit[pages][' . $this->id . ']=edit'; $buttons['edit_page'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $BACK_PATH)) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:editPageProperties', 1))) . '</a>'; // Move page $buttons['move_page'] = '<a href="' . htmlspecialchars($BACK_PATH . 'move_el.php?table=pages&uid=' . $this->id . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '">' . t3lib_iconWorks::getSpriteIcon('actions-page-move', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:move_page', 1))) . '</a>'; } $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_txtemplavoilaM1', 'pagemodule', $BACK_PATH); if ($this->id) { $cacheUrl = $GLOBALS['BACK_PATH'] . 'tce_db.php?vC=' . $GLOBALS['BE_USER']->veriCode() . t3lib_BEfunc::getUrlToken('tceAction') . '&redirect=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . '&cacheCmd=' . $this->id; $buttons['cache'] = '<a href="' . $cacheUrl . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.clear_cache', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-cache-clear') . '</a>'; } } return $buttons; }
/** * Creates a link to the registrations page, showing the attendees for the * given event UID. * * @param tx_seminars_seminar $event * the event to show the registrations for, must be >= 0 * * @return string the URL to the registrations tab with the registration for * the current event, will not be empty */ private function createEventRegistrationsLink(tx_seminars_seminar $event) { $pageData = $this->page->getPageData(); $url = t3lib_BEfunc::getModuleUrl(self::MODULE_NAME, array('id' => $pageData['uid'], 'subModule' => '2', 'eventUid' => $event->getUid())); return '<a href="' . htmlspecialchars($url) . '">' . $GLOBALS['LANG']->getLL('label_show_event_registrations') . '</a>'; }
/** * 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; // Apply predefined values for hidden checkboxes // Set predefined value for DisplayBigControlPanel: if ($this->modTSconfig['properties']['enableDisplayBigControlPanel'] === 'activated') { $this->MOD_SETTINGS['bigControlPanel'] = TRUE; } elseif ($this->modTSconfig['properties']['enableDisplayBigControlPanel'] === 'deactivated') { $this->MOD_SETTINGS['bigControlPanel'] = FALSE; } // Set predefined value for Clipboard: if ($this->modTSconfig['properties']['enableClipBoard'] === 'activated') { $this->MOD_SETTINGS['clipBoard'] = TRUE; } elseif ($this->modTSconfig['properties']['enableClipBoard'] === 'deactivated') { $this->MOD_SETTINGS['clipBoard'] = FALSE; } // Set predefined value for LocalizationView: if ($this->modTSconfig['properties']['enableLocalizationView'] === 'activated') { $this->MOD_SETTINGS['localization'] = TRUE; } elseif ($this->modTSconfig['properties']['enableLocalizationView'] === 'deactivated') { $this->MOD_SETTINGS['localization'] = FALSE; } // Initialize the dblist object: $dblist = t3lib_div::makeInstance('localRecordList'); $dblist->backPath = $BACK_PATH; $dblist->script = t3lib_BEfunc::getModuleUrl('web_list', array(), ''); $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(); $listUrl = substr($dblist->listURL(), strlen($GLOBALS['BACK_PATH'])); // 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($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 extended view, clipboard and localization view --> <div id="typo3-listOptions"> <form action="" method="post">'; // Add "display bigControlPanel" checkbox: if ($this->modTSconfig['properties']['enableDisplayBigControlPanel'] === 'selectable') { $this->body .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[bigControlPanel]', $this->MOD_SETTINGS['bigControlPanel'], '', $this->table ? '&table=' . $this->table : '', 'id="checkLargeControl"'); $this->body .= '<label for="checkLargeControl">' . t3lib_BEfunc::wrapInHelp('xMOD_csh_corebe', 'list_options', $GLOBALS['LANG']->getLL('largeControl', TRUE)) . '</label><br />'; } // Add "clipboard" checkbox: if ($this->modTSconfig['properties']['enableClipBoard'] === 'selectable') { if ($dblist->showClipboard) { $this->body .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[clipBoard]', $this->MOD_SETTINGS['clipBoard'], '', $this->table ? '&table=' . $this->table : '', 'id="checkShowClipBoard"'); $this->body .= '<label for="checkShowClipBoard">' . t3lib_BEfunc::wrapInHelp('xMOD_csh_corebe', 'list_options', $GLOBALS['LANG']->getLL('showClipBoard', TRUE)) . '</label><br />'; } } // Add "localization view" checkbox: if ($this->modTSconfig['properties']['enableLocalizationView'] === 'selectable') { $this->body .= t3lib_BEfunc::getFuncCheck($this->id, 'SET[localization]', $this->MOD_SETTINGS['localization'], '', $this->table ? '&table=' . $this->table : '', 'id="checkLocalization"'); $this->body .= '<label for="checkLocalization">' . t3lib_BEfunc::wrapInHelp('xMOD_csh_corebe', 'list_options', $GLOBALS['LANG']->getLL('localization', TRUE)) . '</label><br />'; } $this->body .= ' </form> </div>'; // Printing clipboard if enabled: if ($this->MOD_SETTINGS['clipBoard'] && $dblist->showClipboard) { $this->body .= $dblist->clipObj->printClipboard(); } // Search box: $sectionTitle = t3lib_BEfunc::wrapInHelp('xMOD_csh_corebe', 'list_searchbox', $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.search', TRUE)); $this->body .= $this->doc->section($sectionTitle, $dblist->getSearchBox(), FALSE, TRUE, FALSE, TRUE); // 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->moduleBody($this->pageinfo, $docHeaderButtons, $markers); // Renders the module page $this->content = $this->doc->render('DB list', $this->content); }
/** * Wraps the title of the items listed in link-tags. The items will link to the page/folder where they originate from * * @param string Title of element - must be htmlspecialchar'ed on beforehand. * @param mixed If array, a record is expected. If string, its a path * @param string Table name * @return string */ function linkItemText($str, $rec, $table = '') { if (is_array($rec) && $table) { if ($this->fileMode) { $str = $GLOBALS['TBE_TEMPLATE']->dfw($str); } else { if (t3lib_extMgm::isLoaded('recordlist')) { $str = '<a href="' . htmlspecialchars(t3lib_BEfunc::getModuleUrl('web_list', array('id' => $rec['pid']), $this->backPath)) . '">' . $str . '</a>'; } } } elseif (file_exists($rec)) { if (!$this->fileMode) { $str = $GLOBALS['TBE_TEMPLATE']->dfw($str); } else { if (t3lib_extMgm::isLoaded('filelist')) { $str = '<a href="' . htmlspecialchars($this->backPath . t3lib_extMgm::extRelPath('filelist') . 'mod1/file_list.php?id=' . dirname($rec)) . '">' . $str . '</a>'; } } } return $str; }
/** * wraps the record titles in the tree with links or not depending on if they are in the TCEforms_nonSelectableItemsArray. * * @param string $title: the title * @param array $v: an array with uid and title of the current item. * @return string the wrapped title */ function wrapTitle($title, $v) { // TODO: language overlay if ($v['uid'] > 0) { $hrefTitle = htmlentities('[id=' . $v['uid'] . '] ' . $v['description']); $js = htmlspecialchars('txttnewsM1js.loadList(\'' . $v['uid'] . '\', $(\'ttnewslist\'), \'' . intval($this->pageID) . '\');'); $out = '<a href="#" onclick="' . $js . '" title="' . $hrefTitle . '">' . $title . '</a>'; // Wrap title in a drag/drop span. $out = '<span class="dragTitle" id="dragTitleID_' . $v['uid'] . '">' . $out . '</span>'; if ($this->showEditIcons) { $out .= $this->makeControl('tt_news_cat', $v); } } else { $grsp = ''; if ($this->storagePid != $this->pageID) { $grsp = ' GRSP'; } if ($this->useStoragePid) { $pidLbl = sprintf($GLOBALS['LANG']->sL('LLL:EXT:tt_news/locallang_tca.xml:tt_news.treeSelect.pageTitleSuffix'), $this->storagePid . $grsp); } else { $pidLbl = $GLOBALS['LANG']->sL('LLL:EXT:tt_news/locallang_tca.xml:tt_news.treeSelect.pageTitleSuffixNoGrsp'); } $pidLbl = ' <span class="typo3-dimmed"><em>' . $pidLbl . '</em></span>'; $hrefTitle = $GLOBALS['LANG']->sL('LLL:EXT:tt_news/mod1/locallang.xml:showAllResetSel'); $out = '<span class="dragTitle" id="dragTitleID_0"> <a href="' . t3lib_BEfunc::getModuleUrl('web_txttnewsM1') . '&id=' . $this->pageID . '" title="' . $hrefTitle . '">' . $title . '</a> </span>' . $pidLbl; } return $out; }
/** * Redirects to the list view. * * @return void */ private function redirectToListView() { $url = t3lib_BEfunc::getModuleUrl(self::MODULE_NAME, array('id' => tx_oelib_PageFinder::getInstance()->getPageUid()), FALSE, TRUE); tx_oelib_headerProxyFactory::getInstance()->getHeaderProxy()->addHeader('Location: ' . $url); }
/** * Main function, creating content in the frame * * @return void */ function main() { global $BE_USER, $LANG, $TCA; // By default, 5 groups are set $this->groupLabels = array(1 => 1, 2 => 1, 3 => 1, 4 => 1, 5 => 1); // "Shortcuts" have been renamed to "Bookmarks" // @deprecated remove shortcuts code in TYPO3 4.7 $shortCutGroups = $BE_USER->getTSConfigProp('options.shortcutGroups'); if ($shortCutGroups !== NULL) { t3lib_div::deprecationLog('options.shortcutGroups - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.bookmarkGroups instead'); } $bookmarkGroups = $BE_USER->getTSConfigProp('options.bookmarkGroups'); if ($bookmarkGroups !== NULL) { $shortCutGroups = $bookmarkGroups; } if (is_array($shortCutGroups) && count($shortCutGroups)) { foreach ($shortCutGroups as $k => $v) { if (strcmp('', $v) && strcmp('0', $v)) { $this->groupLabels[$k] = (string) $v; } elseif ($BE_USER->isAdmin()) { unset($this->groupLabels[$k]); } } } // List of global groups that will be loaded. All global groups have negative IDs. $globalGroups = -100; // Group -100 is kind of superglobal and can't be changed. if (count($this->groupLabels)) { $globalGroups .= ',' . implode(',', array_keys($this->groupLabels)); $globalGroups = str_replace(',', ',-', $globalGroups); // Ugly hack to make the UIDs negative - is there any better solution? } // Fetching shortcuts to display for this user: $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_be_shortcuts', '((userid=' . $BE_USER->user['uid'] . ' AND sc_group>=0) OR sc_group IN (' . $globalGroups . '))', '', 'sc_group,sorting'); // Init vars: $this->lines = array(); $this->linesPre = array(); $this->editSC_rec = ''; $this->selOpt = array(); $formerGr = ''; // Traverse shortcuts while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $mParts = explode('|', $row['module_name']); $row['module_name'] = $mParts[0]; $row['M_module_name'] = $mParts[1]; $mParts = explode('_', $row['M_module_name'] ? $row['M_module_name'] : $row['module_name']); $qParts = parse_url($row['url']); if (!$BE_USER->isAdmin()) { // Check for module access if (!isset($LANG->moduleLabels['tabs_images'][implode('_', $mParts) . '_tab'])) { // Nice hack to check if the user has access to this module - otherwise the translation label would not have been loaded :-) continue; } $page_id = $this->getLinkedPageId($row['url']); if (t3lib_div::testInt($page_id)) { // Check for webmount access if (!$GLOBALS['BE_USER']->isInWebMount($page_id)) { continue; } // Check for record access $pageRow = t3lib_BEfunc::getRecord('pages', $page_id); if (!$GLOBALS['BE_USER']->doesUserHaveAccess($pageRow, $perms = 1)) { continue; } } } if ($this->editSC && $row['uid'] == $this->editSC) { $this->editSC_rec = $row; } $sc_group = $row['sc_group']; if ($sc_group && strcmp($formerGr, $sc_group)) { if ($sc_group != -100) { if ($this->groupLabels[abs($sc_group)] && strcmp('1', $this->groupLabels[abs($sc_group)])) { $label = $this->groupLabels[abs($sc_group)]; } else { $label = $LANG->getLL('shortcut_group_' . abs($sc_group), 1); if (!$label) { $label = $LANG->getLL('shortcut_group', 1) . ' ' . abs($sc_group); } // Fallback label } if ($sc_group >= 0) { $onC = 'if (confirm(' . $GLOBALS['LANG']->JScharCode($LANG->getLL('bookmark_delAllInCat')) . ')){window.location.href=\'alt_shortcut.php?deleteCategory=' . $sc_group . '\';}return false;'; $this->linesPre[] = '<td> </td><td class="bgColor5"><a href="#" onclick="' . htmlspecialchars($onC) . '" title="' . $LANG->getLL('bookmark_delAllInCat', 1) . '">' . $label . '</a></td>'; } else { $label = $LANG->getLL('bookmark_global', 1) . ': ' . ($label ? $label : abs($sc_group)); // Fallback label $this->lines[] = '<td> </td><td class="bgColor5">' . $label . '</td>'; } unset($label); } } $bgColorClass = $row['uid'] == $this->editSC ? 'bgColor5' : ($row['sc_group'] < 0 ? 'bgColor6' : 'bgColor4'); if ($row['description'] && $row['uid'] != $this->editSC) { $label = $row['description']; } else { $label = t3lib_div::fixed_lgd_cs(rawurldecode($qParts['query']), 150); } $titleA = $this->itemLabel($label, $row['module_name'], $row['M_module_name']); $editSH = $row['sc_group'] >= 0 || $BE_USER->isAdmin() ? 'editSh(' . intval($row['uid']) . ');' : "alert('" . $LANG->getLL('bookmark_onlyAdmin') . "')"; $jumpSC = 'jump(unescape(\'' . rawurlencode($row['url']) . '\'),\'' . implode('_', $mParts) . '\',\'' . $mParts[0] . '\');'; $onC = 'if (document.shForm.editShortcut_check && document.shForm.editShortcut_check.checked){' . $editSH . '}else{' . $jumpSC . '}return false;'; if ($sc_group >= 0) { // user defined groups show up first $this->linesPre[] = '<td class="' . $bgColorClass . '"><a href="#" onclick="' . htmlspecialchars($onC) . '"><img src="' . $this->getIcon($row['module_name']) . '" title="' . htmlspecialchars($titleA) . '" alt="" /></a></td>'; } else { $this->lines[] = '<td class="' . $bgColorClass . '"><a href="#" onclick="' . htmlspecialchars($onC) . '"><img src="' . $this->getIcon($row['module_name']) . '" title="' . htmlspecialchars($titleA) . '" alt="" /></a></td>'; } if (trim($row['description'])) { $kkey = strtolower(substr($row['description'], 0, 20)) . '_' . $row['uid']; $this->selOpt[$kkey] = '<option value="' . htmlspecialchars($jumpSC) . '">' . htmlspecialchars(t3lib_div::fixed_lgd_cs($row['description'], 50)) . '</option>'; } $formerGr = $row['sc_group']; } ksort($this->selOpt); array_unshift($this->selOpt, '<option>[' . $LANG->getLL('bookmark_selSC', 1) . ']</option>'); $this->editLoadedFunc(); $this->editPageIdFunc(); if (!$this->editLoaded && t3lib_extMgm::isLoaded('cms')) { $editIdCode = '<td nowrap="nowrap">' . $LANG->getLL('bookmark_editID', 1) . ': <input type="text" value="' . ($this->editError ? htmlspecialchars($this->editPage) : '') . '" name="editPage"' . $this->doc->formWidth(15) . ' onchange="submitEditPage(this.value);" />' . ($this->editError ? ' <strong><span class="typo3-red">' . htmlspecialchars($this->editError) . '</span></strong>' : '') . (is_array($this->theEditRec) ? ' <strong>' . $LANG->getLL('bookmark_loadEdit', 1) . ' \'' . t3lib_BEfunc::getRecordTitle('pages', $this->theEditRec, TRUE) . '\'</strong> (' . htmlspecialchars($this->editPath) . ')' : '') . ($this->searchFor ? ' ' . $LANG->getLL('bookmark_searchFor', 1) . ' <strong>\'' . htmlspecialchars($this->searchFor) . '\'</strong>' : '') . '</td>'; } else { $editIdCode = ''; } // Adding CSH: $editIdCode .= '<td> ' . t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'bookmarks', $GLOBALS['BACK_PATH'], '', TRUE) . '</td>'; // Compile it all: $this->content .= ' <table border="0" cellpadding="0" cellspacing="0" width="99%"> <tr> <td> <!-- Shortcut Display Table: --> <table border="0" cellpadding="0" cellspacing="2" id="typo3-shortcuts"> <tr> '; // "Shortcuts" have been renamed to "Bookmarks" // @deprecated remove shortcuts code in TYPO3 4.7 $useShortcuts = $GLOBALS['BE_USER']->getTSConfigVal('options.enableShortcuts'); $useBookmarks = $GLOBALS['BE_USER']->getTSConfigVal('options.enableBookmarks'); if ($useShortcuts || $useBookmarks) { $this->content .= implode(' ', $this->lines); if ($useShortcuts) { t3lib_div::deprecationLog('options.enableShortcuts - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.enableBookmarks instead'); } } $this->content .= $editIdCode . ' </tr> </table> </td> <td align="right">'; if ($this->hasWorkspaceAccess()) { $this->content .= $this->workspaceSelector() . t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'workspaceSelector', $GLOBALS['BACK_PATH'], '', TRUE); } $this->content .= ' </td> </tr> </table> '; // Launch Edit page: if ($this->theEditRec['uid']) { $this->content .= $this->doc->wrapScriptTags('top.loadEditId(' . $this->theEditRec['uid'] . ');'); } // Load alternative table/uid into editing form. if (count($this->alternativeTableUid) == 2 && isset($TCA[$this->alternativeTableUid[0]]) && t3lib_div::testInt($this->alternativeTableUid[1])) { $JSaction = t3lib_BEfunc::editOnClick('&edit[' . $this->alternativeTableUid[0] . '][' . $this->alternativeTableUid[1] . ']=edit', '', 'dummy.php'); $this->content .= $this->doc->wrapScriptTags('function editArbitraryElement() { top.content.' . $JSaction . '; } editArbitraryElement();'); } // Load search for something. if ($this->searchFor) { $urlParameters = array(); $urlParameters['id'] = intval($GLOBALS['WEBMOUNTS'][0]); $urlParameters['search_field'] = $this->searchFor; $urlParameters['search_levels'] = 4; $this->content .= $this->doc->wrapScriptTags('jump(unescape("' . rawurlencode(t3lib_BEfunc::getModuleUrl('web_list', $urlParameters, '')) . '"), "web_list", "web");'); } }
/** * Creates the URL to this script, including all relevant GPvars * Fixed GPvars are id, table, imagemode, returlUrl, search_field, search_levels and showLimit * The GPvars "sortField" and "sortRev" are also included UNLESS they are found in the $exclList variable. * * @param string Alternative id value. Enter blank string for the current id ($this->id) * @param string Tablename to display. Enter "-1" for the current table. * @param string Commalist of fields NOT to include ("sortField" or "sortRev") * @return string URL */ function listURL($altId = '', $table = '', $exclList = '') { return t3lib_BEfunc::getModuleUrl('web_txttnewsM1') . '&id=' . (strcmp($altId, '') ? $altId : $this->id) . ($this->thumbs ? '&showThumbs=' . $this->thumbs : '') . ($this->searchString ? '&search_field=' . rawurlencode($this->searchString) : '') . ($this->searchLevels ? '&searchLevels=' . rawurlencode($this->searchLevels) : '') . ($this->showLimit ? '&showLimit=' . rawurlencode($this->showLimit) : '') . ($this->firstElementNumber ? '&pointer=' . rawurlencode($this->firstElementNumber) : '') . ((!$exclList || !t3lib_div::inList($exclList, 'sortField')) && $this->sortField ? '&sortField=' . rawurlencode($this->sortField) : '') . ((!$exclList || !t3lib_div::inList($exclList, 'sortRev')) && $this->sortRev ? '&sortRev=' . rawurlencode($this->sortRev) : '') . ($this->category ? '&category=' . $this->category : ''); }
/** * Main function * Will issue a location-header, redirecting either BACK or to a new alt_doc.php instance... * * @return void */ function main() { // Get this record $origRow = t3lib_BEfunc::getRecord($this->P['table'], $this->P['uid']); // Get TSconfig for it. $TSconfig = t3lib_BEfunc::getTCEFORM_TSconfig($this->table, is_array($origRow) ? $origRow : array('pid' => $this->P['pid'])); // Set [params][pid] if (substr($this->P['params']['pid'], 0, 3) == '###' && substr($this->P['params']['pid'], -3) == '###') { $this->pid = intval($TSconfig['_' . substr($this->P['params']['pid'], 3, -3)]); } else { $this->pid = intval($this->P['params']['pid']); } // Make redirect: if (!strcmp($this->pid, '') || strcmp($this->id, '')) { // If pid is blank OR if id is set, then return... $redirectUrl = t3lib_div::sanitizeLocalUrl($this->P['returnUrl']); } else { // Otherwise, show the list: $urlParameters = array(); $urlParameters['id'] = $this->pid; $urlParameters['table'] = $this->P['params']['table']; $urlParameters['returnUrl'] = t3lib_div::getIndpEnv('REQUEST_URI'); $redirectUrl = t3lib_BEfunc::getModuleUrl('web_list', $urlParameters); } t3lib_utility_Http::redirect($redirectUrl); }
/** * Returns a "CSV export" image tag that is linked to the CSV export, * corresponding to the list that is visible in the BE. * * This icon is intended to be used next to the "create new record" icon. * * @return string the HTML source code of the linked CSV icon */ protected function getCsvIcon() { $pageData = $this->page->getPageData(); $langCsv = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.csv', 1); $csvUrl = t3lib_BEfunc::getModuleUrl(self::MODULE_NAME, array('id' => $pageData['uid'], 'csv' => '1', 'tx_seminars_pi2[table]' => $this->tableName)); $result = TAB . TAB . '<div id="typo3-csvLink">' . LF . TAB . TAB . TAB . '<a href="' . htmlspecialchars($csvUrl) . $this->getAdditionalCsvParameters() . '">' . LF . TAB . TAB . TAB . TAB . '<img src="/' . t3lib_extMgm::siteRelPath('seminars') . 'Resources/Public/Icons/Csv.gif" title="' . $langCsv . '" alt="" class="icon" />' . TAB . TAB . TAB . TAB . $langCsv . LF . TAB . TAB . TAB . '</a>' . LF . TAB . TAB . '</div>' . LF; return $result; }
/** * Adding CM element for DBlist * * @param string Table name * @param integer UID for the current record. * @param array Record of the element (needs "pid" field if not pages-record) * @return array Item array, element in $menuItems * @internal */ function DB_db_list($table, $uid, $rec) { $urlParams = array(); $urlParams['id'] = $table == 'pages' ? $uid : $rec['pid']; $urlParams['table'] = $table == 'pages' ? '' : $table; $url = t3lib_BEfunc::getModuleUrl('web_list', $urlParams, '', TRUE); return $this->linkItem($GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLL('CM_db_list')), $this->excludeIcon(t3lib_iconWorks::getSpriteIcon('actions-system-list-open')), "top.nextLoadModuleUrl='" . $url . "';top.goToModule('web_list',1);", 0); }
/** * Assemble the link to select a single log run * * @param string $str Link text * @param integer $logRun Id of the log run (microtime) * @return string */ function linkLogRun($str, $logRun) { $url = t3lib_BEfunc::getModuleUrl($GLOBALS['MCONF']['name'], array('SET' => array('logrun' => $logRun))); $content = '<a href="' . $url . '">' . $str . '</a>'; return $content; }
* The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * A copy is found in the textfile GPL.txt and important notices to the license * from the author is found in LICENSE.txt distributed with these scripts. * * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ /** * This is a wrapper file for direct calls to list module. * It's deprecated since 4.5, use proper link generation. * * @author Steffen Kamper <*****@*****.**> * @deprecated * */ require 'init.php'; $query = t3lib_div::getIndpEnv('QUERY_STRING'); t3lib_div::deprecationLog('The list module is a system extension now, do not link to this file.' . LF . 'Referer: ' . t3lib_div::getIndpEnv('HTTP_REFERER')); if (t3lib_extMgm::isLoaded('recordlist')) { t3lib_utility_Http::redirect(t3lib_BEfunc::getModuleUrl('web_list', array(), '', TRUE) . '&' . $query); } else { $title = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:extension.not.installed'), 'list'); $message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:link.to.dblist.correctly'); throw new RuntimeException($title . ': ' . $message); }
/** * Creates the tool bar links for the "edit" section of the Admin Panel. * * @return string A string containing images wrapped in <a>-tags linking them to proper functions. */ public function ext_makeToolBar() { // If mod.web_list.newContentWiz.overrideWithExtension is set, use that extension's create new content wizard instead: $tsConfig = t3lib_BEfunc::getModTSconfig($this->pageinfo['uid'], 'mod.web_list'); $tsConfig = $tsConfig['properties']['newContentWiz.']['overrideWithExtension']; $newContentWizScriptPath = t3lib_extMgm::isLoaded($tsConfig) ? t3lib_extMgm::extRelPath($tsConfig) . 'mod1/db_new_content_el.php' : TYPO3_mainDir . 'sysext/cms/layout/db_new_content_el.php'; $perms = $GLOBALS['BE_USER']->calcPerms($GLOBALS['TSFE']->page); $langAllowed = $GLOBALS['BE_USER']->checkLanguageAccess($GLOBALS['TSFE']->sys_language_uid); $id = $GLOBALS['TSFE']->id; $toolBar = '<a href="' . htmlspecialchars(TYPO3_mainDir . 'show_rechis.php?element=' . rawurlencode('pages:' . $id) . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '#latest">' . '<img ' . t3lib_iconWorks::skinImg(TYPO3_mainDir, 'gfx/history2.gif', 'width="13" height="12"') . ' hspace="2" border="0" align="top" title="' . $this->extGetLL('edit_recordHistory') . '" alt="" /></a>'; if ($perms & 16 && $langAllowed) { $params = ''; if ($GLOBALS['TSFE']->sys_language_uid) { $params = '&sys_language_uid=' . $GLOBALS['TSFE']->sys_language_uid; } $toolBar .= '<a href="' . htmlspecialchars($newContentWizScriptPath . '?id=' . $id . $params . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '">' . '<img ' . t3lib_iconWorks::skinImg(TYPO3_mainDir, 'gfx/new_record.gif', 'width="16" height="12"') . ' hspace="1" border="0" align="top" title="' . $this->extGetLL('edit_newContentElement') . '" alt="" /></a>'; } if ($perms & 2) { $toolBar .= '<a href="' . htmlspecialchars(TYPO3_mainDir . 'move_el.php?table=pages&uid=' . $id . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '">' . '<img ' . t3lib_iconWorks::skinImg(TYPO3_mainDir, 'gfx/move_page.gif', 'width="11" height="12') . ' hspace="2" border="0" align="top" title="' . $this->extGetLL('edit_move_page') . '" alt="" /></a>'; } if ($perms & 8) { $toolBar .= '<a href="' . htmlspecialchars(TYPO3_mainDir . 'db_new.php?id=' . $id . '&pagesOnly=1&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '">' . '<img ' . t3lib_iconWorks::skinImg(TYPO3_mainDir, 'gfx/new_page.gif', 'width="13" height="12"') . ' hspace="0" border="0" align="top" title="' . $this->extGetLL('edit_newPage') . '" alt="" /></a>'; } if ($perms & 2) { $params = '&edit[pages][' . $id . ']=edit'; $toolBar .= '<a href="' . htmlspecialchars(TYPO3_mainDir . 'alt_doc.php?' . $params . '&noView=1&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '">' . '<img ' . t3lib_iconWorks::skinImg(TYPO3_mainDir, 'gfx/edit2.gif', 'width="11" height="12"') . 'hspace="2" border="0" align="top" title="' . $this->extGetLL('edit_editPageProperties') . '" alt="" /></a>'; if ($GLOBALS['TSFE']->sys_language_uid && $langAllowed) { $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,pid,t3ver_state', 'pages_language_overlay', 'pid=' . intval($id) . ' AND sys_language_uid=' . $GLOBALS['TSFE']->sys_language_uid . $GLOBALS['TSFE']->sys_page->enableFields('pages_language_overlay'), '', '', '1'); $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); $GLOBALS['TSFE']->sys_page->versionOL('pages_language_overlay', $row); if (is_array($row)) { $params = '&edit[pages_language_overlay][' . $row['uid'] . ']=edit'; $toolBar .= '<a href="' . htmlspecialchars(TYPO3_mainDir . 'alt_doc.php?' . $params . '&noView=1&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '">' . '<img ' . t3lib_iconWorks::skinImg(TYPO3_mainDir, 'gfx/edit3.gif', 'width="11" height="12"') . ' hspace="2" border="0" align="top" title="' . $this->extGetLL('edit_editPageOverlay') . '" alt="" /></a>'; } } } if ($GLOBALS['BE_USER']->check('modules', 'web_list')) { $urlParams = array(); $urlParams['id'] = $id; $urlParams['returnUrl'] = t3lib_div::getIndpEnv('REQUEST_URI'); $toolBar .= '<a href="' . htmlspecialchars(TYPO3_mainDir . t3lib_BEfunc::getModuleUrl('web_list', $urlParams)) . '">' . '<img ' . t3lib_iconWorks::skinImg(TYPO3_mainDir, 'gfx/list.gif', 'width="11" height="11"') . ' hspace="2" border="0" align="top" title="' . $this->extGetLL('edit_db_list') . '" alt="" /></a>'; } return $toolBar; }