/** * Initialize the module output * * @return void */ function init() { global $LANG; // Create internal template object: $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->setModuleTemplate('templates/show_rechis.html'); // Start the page header: $this->content .= $this->doc->header($LANG->getLL('title')); $this->content .= $this->doc->spacer(5); }
/** * Initialization of the class * * @return void */ function init() { // GPvars: $this->P = t3lib_div::_GP('P'); $this->TABLECFG = t3lib_div::_GP('TABLE'); // Setting options: $this->xmlStorage = $this->P['params']['xmlOutput']; $this->numNewRows = t3lib_div::intInRange($this->P['params']['numNewRows'], 1, 50, 5); // Textareas or input fields: $this->inputStyle = isset($this->TABLECFG['textFields']) ? $this->TABLECFG['textFields'] : 1; // Document template object: $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->setModuleTemplate('templates/wizard_table.html'); $this->doc->JScode = $this->doc->wrapScriptTags(' function jumpToUrl(URL,formEl) { // window.location.href = URL; } '); // Setting form tag: list($rUri) = explode('#', t3lib_div::getIndpEnv('REQUEST_URI')); $this->doc->form = '<form action="' . htmlspecialchars($rUri) . '" method="post" name="wizardForm">'; // If save command found, include tcemain: if ($_POST['savedok_x'] || $_POST['saveandclosedok_x']) { $this->include_once[] = PATH_t3lib . 'class.t3lib_tcemain.php'; } $this->tableParsing_delimiter = '|'; $this->tableParsing_quote = ''; }
/** * Initialize module header etc and call extObjContent function * * @return void */ function main() { global $BE_USER, $LANG, $BACK_PATH; // Access check... // The page will show only if there is a valid page and if this page may be viewed by the user $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; // Template markers $markers = array('CSH' => '', 'FUNC_MENU' => '', 'CONTENT' => ''); $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $BACK_PATH; $this->doc->setModuleTemplate('templates/func.html'); // ************************** // Main // ************************** if ($this->id && $access) { // JavaScript $this->doc->JScode = $this->doc->wrapScriptTags(' script_ended = 0; function jumpToUrl(URL) { // window.location.href = URL; } '); $this->doc->postCode = $this->doc->wrapScriptTags(' script_ended = 1; if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . '; '); // Setting up the context sensitive menu: $this->doc->getContextMenuCode(); $this->doc->form = '<form action="index.php" method="post"><input type="hidden" name="id" value="' . $this->id . '" />'; $vContent = $this->doc->getVersionSelector($this->id, 1); if ($vContent) { $this->content .= $this->doc->section('', $vContent); } $this->extObjContent(); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CSH'] = $docHeaderButtons['csh']; $markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']); $markers['CONTENT'] = $this->content; } else { // If no access or if ID == zero $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', $LANG->getLL('clickAPage_content'), $LANG->getLL('title'), t3lib_FlashMessage::INFO); $this->content = $flashMessage->render(); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CSH'] = $docHeaderButtons['csh']; $markers['CONTENT'] = $this->content; } // Build the <body> for the module $this->content = $this->doc->startPage($LANG->getLL('title')); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Initialize module header etc and call extObjContent function * * @return void */ function main() { global $BE_USER, $LANG, $BACK_PATH; // Access check... // The page will show only if there is a valid page and if this page may be viewed by the user $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; if ($this->id && $access || $BE_USER->user['admin'] && !$this->id) { $this->CALC_PERMS = $BE_USER->calcPerms($this->pageinfo); if ($BE_USER->user['admin'] && !$this->id) { $this->pageinfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0); } $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $BACK_PATH; $this->doc->setModuleTemplate('templates/info.html'); $this->doc->tableLayout = array('0' => array('0' => array('<td valign="top"><strong>', '</strong></td>'), "defCol" => array('<td><img src="' . $this->doc->backPath . 'clear.gif" width="10" height="1" alt="" /></td><td valign="top"><strong>', '</strong></td>')), "defRow" => array("0" => array('<td valign="top">', '</td>'), "defCol" => array('<td><img src="' . $this->doc->backPath . 'clear.gif" width="10" height="1" alt="" /></td><td valign="top">', '</td>'))); // JavaScript $this->doc->JScode = $this->doc->wrapScriptTags(' script_ended = 0; function jumpToUrl(URL) { // window.location.href = URL; } '); $this->doc->postCode = $this->doc->wrapScriptTags(' script_ended = 1; if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . '; '); // Setting up the context sensitive menu: $this->doc->getContextMenuCode(); $this->doc->form = '<form action="index.php" method="post" name="webinfoForm">'; $vContent = $this->doc->getVersionSelector($this->id, 1); if ($vContent) { $this->content .= $this->doc->section('', $vContent); } $this->extObjContent(); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $this->content); // Build the <body> for the module $this->content = $this->doc->startPage($LANG->getLL('title')); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); } else { // If no access or if ID == zero $this->doc = t3lib_div::makeInstance('mediumDoc'); $this->doc->backPath = $BACK_PATH; $this->content .= $this->doc->startPage($LANG->getLL('title')); $this->content .= $this->doc->header($LANG->getLL('title')); $this->content .= $this->doc->spacer(5); $this->content .= $this->doc->spacer(10); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); } }
/** * Initialization of the class * * @return void */ function init() { // Setting GPvars: $this->P = t3lib_div::_GP('P'); $this->popView = t3lib_div::_GP('popView'); $this->R_URI = t3lib_div::linkThisScript(array('popView' => '')); // "Module name": $this->MCONF['name'] = 'xMOD_wizard_rte.php'; // Starting the document template object: $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->setModuleTemplate('templates/wizard_rte.html'); $this->doc->divClass = ''; // Need to NOT have the page wrapped in DIV since if we do that we destroy the feature that the RTE spans the whole height of the page!!! $this->doc->form = '<form action="tce_db.php" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">'; }
/** * Initializes the module for display of the settings form. * * @return void */ function init() { $this->MCONF = $GLOBALS['MCONF']; // Returns the script user - that is the REAL logged in user! ($GLOBALS[BE_USER] might be another user due to simulation!) $scriptUser = $this->getRealScriptUserObj(); // ... and checking module access for the logged in user. $scriptUser->modAccess($this->MCONF, 1); $this->isAdmin = $scriptUser->isAdmin(); // Getting the 'override' values as set might be set in User TSconfig $this->overrideConf = $GLOBALS['BE_USER']->getTSConfigProp('setup.override'); // Getting the disabled fields might be set in User TSconfig (eg setup.fields.password.disabled=1) $this->tsFieldConf = $GLOBALS['BE_USER']->getTSConfigProp('setup.fields'); // Create instance of object for output of data $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->setModuleTemplate('templates/setup.html'); $this->doc->JScodeLibArray['dyntabmenu'] = $this->doc->getDynTabMenuJScode(); $this->doc->form = '<form action="index.php" method="post" name="usersetup" enctype="application/x-www-form-urlencoded">'; $this->doc->tableLayout = array('defRow' => array('0' => array('<td class="td-label">', '</td>'), 'defCol' => array('<td valign="top">', '</td>'))); $this->doc->table_TR = '<tr>'; $this->doc->table_TABLE = '<table border="0" cellspacing="1" cellpadding="2" class="typo3-usersettings">'; }
/** * Initialization * * @return void */ function init() { global $LANG, $BACK_PATH; $this->MCONF = $GLOBALS['MCONF']; $this->menuConfig(); $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $BACK_PATH; $this->doc->setModuleTemplate('templates/dbint.html'); $this->doc->form = '<form action="" method="post" name="' . $this->formName . '">'; // JavaScript $this->doc->JScode = ' <script language="javascript" type="text/javascript"> script_ended = 0; function jumpToUrl(URL) { window.location.href = URL; } </script> '; $this->doc->table_TABLE = '<table border="0" cellspacing="0" cellpadding="0" class="typo3-dblist" style="width:400px!important;"> <colgroup><col width="24"><col width="300"><col width="76"></colgroup>'; $this->doc->tableLayout = array('0' => array('defCol' => array('<td class="t3-row-header"><img src="' . $this->doc->backPath . 'clear.gif" width="10" height="1" alt="" /></td><td valign="top" class="t3-row-header"><strong>', '</strong></td>')), 'defRow' => array('0' => array('<td valign="top">', '</td>'), '1' => array('<td valign="top">', '</td>'), 'defCol' => array('<td><img src="' . $this->doc->backPath . 'clear.gif" width="15" height="1" alt="" /></td><td valign="top">', '</td>'))); }
/** * Constructor, initializing internal variables. * * @return void */ function init() { global $BE_USER, $LANG, $BACK_PATH; // Setting internal vars: $this->sys_language = intval(t3lib_div::_GP('sys_language')); $this->page_id = intval(t3lib_div::_GP('uid')); $this->table = t3lib_div::_GP('table'); $this->R_URI = t3lib_div::_GP('returnUrl'); $this->input_moveUid = t3lib_div::_GP('moveUid'); $this->moveUid = $this->input_moveUid ? $this->input_moveUid : $this->page_id; $this->makeCopy = t3lib_div::_GP('makeCopy'); // Select-pages where clause for read-access: $this->perms_clause = $BE_USER->getPagePermsClause(1); // Starting the document template object: $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $BACK_PATH; $this->doc->setModuleTemplate('templates/move_el.html'); $this->doc->JScode = ''; // Starting document content (header): $this->content = ''; $this->content .= $this->doc->header($LANG->getLL('movingElement')); $this->content .= $this->doc->spacer(5); }
/** * Main function of the module. Write the content to $this->content * * @return void */ function main() { global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS; // Template markers $markers = array('CSH' => '', 'FUNC_MENU' => '', 'WS_MENU' => '', 'CONTENT' => ''); // Setting module configuration: $this->MCONF = $GLOBALS['MCONF']; $this->REQUEST_URI = str_replace('&sendToReview=1', '', t3lib_div::getIndpEnv('REQUEST_URI')); // Draw the header. $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $BACK_PATH; $this->doc->setModuleTemplate('templates/version.html'); // Add styles $this->doc->inDocStylesArray[$GLOBALS['MCONF']['name']] = ' .version-diff-1 { background-color: green; } .version-diff-2 { background-color: red; } '; // Setting up the context sensitive menu: $this->doc->getContextMenuCode(); // Getting input data: $this->id = intval(t3lib_div::_GP('id')); // Page id. If set, indicates activation from Web>Versioning module if (!$this->id) { $this->uid = intval(t3lib_div::_GP('uid')); // Record uid. Goes with table name to indicate specific record $this->table = t3lib_div::_GP('table'); // Record table. Goes with uid to indicate specific record } else { $this->uid = $this->id; $this->table = 'pages'; } $this->details = t3lib_div::_GP('details'); // Page id. If set, indicates activation from Web>Versioning module $this->diffOnly = t3lib_div::_GP('diffOnly'); // Flag. If set, shows only the offline version and with diff-view // Force this setting: $this->MOD_SETTINGS['expandSubElements'] = TRUE; $this->MOD_SETTINGS['diff'] = $this->details || $this->MOD_SETTINGS['diff'] ? 1 : 0; // Reading the record: $record = t3lib_BEfunc::getRecord($this->table, $this->uid); if ($record['pid'] == -1) { $record = t3lib_BEfunc::getRecord($this->table, $record['t3ver_oid']); } $this->recordFound = is_array($record); $pidValue = $this->table === 'pages' ? $this->uid : $record['pid']; // Checking access etc. if ($this->recordFound && $TCA[$this->table]['ctrl']['versioningWS']) { $this->doc->form = '<form action="" method="post">'; $this->uid = $record['uid']; // Might have changed if new live record was found! // Access check! // The page will show only if there is a valid page and if this page may be viewed by the user $this->pageinfo = t3lib_BEfunc::readPageAccess($pidValue, $this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; if ($pidValue && $access || $BE_USER->user['admin'] && !$pidValue) { // JavaScript $this->doc->JScode .= ' <script language="javascript" type="text/javascript"> script_ended = 0; function jumpToUrl(URL) { window.location.href = URL; } function hlSubelements(origId, verId, over, diffLayer) { // if (over) { document.getElementById(\'orig_\'+origId).attributes.getNamedItem("class").nodeValue = \'typo3-ver-hl\'; document.getElementById(\'ver_\'+verId).attributes.getNamedItem("class").nodeValue = \'typo3-ver-hl\'; if (diffLayer) { document.getElementById(\'diff_\'+verId).style.visibility = \'visible\'; } } else { document.getElementById(\'orig_\'+origId).attributes.getNamedItem("class").nodeValue = \'typo3-ver\'; document.getElementById(\'ver_\'+verId).attributes.getNamedItem("class").nodeValue = \'typo3-ver\'; if (diffLayer) { document.getElementById(\'diff_\'+verId).style.visibility = \'hidden\'; } } } </script> '; // If another page module was specified, replace the default Page module with the new one $newPageModule = trim($BE_USER->getTSConfigVal('options.overridePageModule')); $this->pageModule = t3lib_BEfunc::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout'; // Setting publish access permission for workspace: $this->publishAccess = $BE_USER->workspacePublishAccess($BE_USER->workspace); // Render content: if ($this->id) { $this->workspaceMgm(); } else { $this->versioningMgm(); } } $this->content .= $this->doc->spacer(10); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CSH'] = $docHeaderButtons['csh']; $markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']); $markers['WS_MENU'] = $this->workspaceMenu(); $markers['CONTENT'] = $this->content; } else { // If no access or id value, create empty document $this->content = $this->doc->section($LANG->getLL('clickAPage_header'), $LANG->getLL('clickAPage_content'), 0, 1); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); $markers['CONTENT'] = $this->content; } // Build the <body> for the module $this->content = $this->doc->startPage($LANG->getLL('title')); $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); $this->content .= $this->doc->endPage(); $this->content = $this->doc->insertStylesAndJS($this->content); }
/** * Initializes the module. See <code>t3lib_SCbase::init()</code> for more information. * * @return void */ function init() { // Setting module configuration: $this->MCONF = $GLOBALS['MCONF']; // Initialize Document Template object: $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->setModuleTemplate('templates/ws_forms.html'); $this->doc->form = '<form action="' . t3lib_div::getIndpEnv('SCRIPT_NAME') . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">'; $this->doc->getContextMenuCode(); // Parent initialization: t3lib_SCbase::init(); }
/** * Initialize the normal module operation * * @return void */ function init() { global $BE_USER, $LANG, $BACK_PATH; // Setting more GPvars: $this->popViewId = t3lib_div::_GP('popViewId'); $this->popViewId_addParams = t3lib_div::_GP('popViewId_addParams'); $this->viewUrl = t3lib_div::_GP('viewUrl'); $this->editRegularContentFromId = t3lib_div::_GP('editRegularContentFromId'); $this->recTitle = t3lib_div::_GP('recTitle'); $this->disHelp = t3lib_div::_GP('disHelp'); $this->noView = t3lib_div::_GP('noView'); $this->perms_clause = $BE_USER->getPagePermsClause(1); // Set other internal variables: $this->R_URL_getvars['returnUrl'] = $this->retUrl; $this->R_URI = $this->R_URL_parts['path'] . '?' . t3lib_div::implodeArrayForUrl('', $this->R_URL_getvars); // MENU-ITEMS: // If array, then it's a selector box menu // If empty string it's just a variable, that'll be saved. // Values NOT in this array will not be saved in the settings-array for the module. $this->MOD_MENU = array('showPalettes' => ''); // Setting virtual document name $this->MCONF['name'] = 'xMOD_alt_doc.php'; // CLEANSE SETTINGS $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']); // Create an instance of the document template object $this->doc = $GLOBALS['TBE_TEMPLATE']; $this->doc->backPath = $BACK_PATH; $this->doc->setModuleTemplate('templates/alt_doc.html'); $this->doc->form = '<form action="' . htmlspecialchars($this->R_URI) . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="document.editform._scrollPosition.value=(document.documentElement.scrollTop || document.body.scrollTop); return TBE_EDITOR.checkSubmit(1);">'; $this->doc->getPageRenderer()->loadPrototype(); $this->doc->JScode = $this->doc->wrapScriptTags(' function jumpToUrl(URL,formEl) { // if (!TBE_EDITOR.isFormChanged()) { window.location.href = URL; } else if (formEl && formEl.type=="checkbox") { formEl.checked = formEl.checked ? 0 : 1; } } // Object: TS: // passwordDummy and decimalSign are used by tbe_editor.js and have to be declared here as // TS object overwrites the object declared in tbe_editor.js function typoSetup () { // this.uniqueID = ""; this.passwordDummy = "********"; this.decimalSign = "."; } var TS = new typoSetup(); // Info view: function launchView(table,uid,bP) { // var backPath= bP ? bP : ""; var thePreviewWindow=""; thePreviewWindow = window.open(backPath+"show_item.php?table="+encodeURIComponent(table)+"&uid="+encodeURIComponent(uid),"ShowItem"+TS.uniqueID,"height=300,width=410,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0"); if (thePreviewWindow && thePreviewWindow.focus) { thePreviewWindow.focus(); } } function deleteRecord(table,id,url) { // if ( ' . ($GLOBALS['BE_USER']->jsConfirmation(4) ? 'confirm(' . $LANG->JScharCode($LANG->getLL('deleteWarning')) . ')' : '1==1') . ' ) { window.location.href = "tce_db.php?cmd["+table+"]["+id+"][delete]=1' . t3lib_BEfunc::getUrlToken('tceAction') . '&redirect="+escape(url)+"&vC=' . $BE_USER->veriCode() . '&prErr=1&uPT=1"; } return false; } ' . (isset($_POST['_savedokview_x']) && $this->popViewId ? 'if (window.opener) { ' . t3lib_BEfunc::viewOnClick($this->popViewId, '', t3lib_BEfunc::BEgetRootLine($this->popViewId), '', $this->viewUrl, $this->popViewId_addParams, FALSE) . ' } else { ' . t3lib_BEfunc::viewOnClick($this->popViewId, '', t3lib_BEfunc::BEgetRootLine($this->popViewId), '', $this->viewUrl, $this->popViewId_addParams) . ' } ' : '')); // Setting up the context sensitive menu: $this->doc->getContextMenuCode(); $this->doc->bodyTagAdditions = 'onload="window.scrollTo(0,' . t3lib_div::intInRange(t3lib_div::_GP('_scrollPosition'), 0, 10000) . ');"'; }
/** * Constructor, initializing internal variables. * * @return void */ function init() { global $BE_USER, $BACK_PATH, $TBE_MODULES_EXT; // Setting class files to include: if (is_array($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'])) { $this->include_once = array_merge($this->include_once, $TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']); } // Setting internal vars: $this->id = intval(t3lib_div::_GP('id')); $this->sys_language = intval(t3lib_div::_GP('sys_language_uid')); $this->R_URI = t3lib_div::_GP('returnUrl'); $this->colPos = t3lib_div::_GP('colPos'); $this->uid_pid = intval(t3lib_div::_GP('uid_pid')); $this->MCONF['name'] = 'xMOD_db_new_content_el'; $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id, 'mod.wizards.newContentElement'); $config = t3lib_BEfunc::getPagesTSconfig($this->id); $this->config = $config['mod.']['wizards.']['newContentElement.']; // Starting the document template object: $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $BACK_PATH; $this->doc->setModuleTemplate('templates/db_new_content_el.html'); $this->doc->JScode = ''; $this->doc->JScodeLibArray['dyntabmenu'] = $this->doc->getDynTabMenuJScode(); $this->doc->form = '<form action="" name="editForm"><input type="hidden" name="defValues" value="" />'; // Setting up the context sensitive menu: $this->doc->getContextMenuCode(); // Getting the current page and receiving access information (used in main()) $perms_clause = $BE_USER->getPagePermsClause(1); $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $perms_clause); $this->access = is_array($this->pageinfo) ? 1 : 0; }
/** * Initialization the class * * @return void */ function init() { // GPvars: $this->P = t3lib_div::_GP('P'); $this->special = t3lib_div::_GP('special'); $this->FORMCFG = t3lib_div::_GP('FORMCFG'); // Setting options: $this->xmlStorage = $this->P['params']['xmlOutput']; // Document template object: $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->setModuleTemplate('templates/wizard_forms.html'); $this->doc->JScode = $this->doc->wrapScriptTags(' function jumpToUrl(URL,formEl) { // window.location.href = URL; } '); // Setting form tag: list($rUri) = explode('#', t3lib_div::getIndpEnv('REQUEST_URI')); $this->doc->form = '<form action="' . htmlspecialchars($rUri) . '" method="post" name="wizardForm">'; // If save command found, include tcemain: if ($_POST['savedok_x'] || $_POST['saveandclosedok_x']) { $this->include_once[] = PATH_t3lib . 'class.t3lib_tcemain.php'; } }
/** * Constructor function for the class * * @return void */ function init() { global $BE_USER, $LANG, $BACK_PATH; // page-selection permission clause (reading) $this->perms_clause = $BE_USER->getPagePermsClause(1); // this will hide records from display - it has nothing todo with user rights!! if ($pidList = $GLOBALS['BE_USER']->getTSConfigVal('options.hideRecords.pages')) { if ($pidList = $GLOBALS['TYPO3_DB']->cleanIntList($pidList)) { $this->perms_clause .= ' AND pages.uid NOT IN (' . $pidList . ')'; } } // Setting GPvars: $this->id = intval(t3lib_div::_GP('id')); // The page id to operate from $this->returnUrl = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl')); $this->pagesOnly = t3lib_div::_GP('pagesOnly'); // Create instance of template class for output $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $BACK_PATH; $this->doc->setModuleTemplate('templates/db_new.html'); $this->doc->JScode = ''; // Setting up the context sensitive menu: $this->doc->getContextMenuCode(); // Creating content $this->content = ''; $this->content .= $this->doc->header($LANG->sL('LLL:EXT:lang/locallang_core.php:db_new.php.pagetitle')); // Id a positive id is supplied, ask for the page record with permission information contained: if ($this->id > 0) { $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause); } // If a page-record was returned, the user had read-access to the page. if ($this->pageinfo['uid']) { // Get record of parent page $this->pidInfo = t3lib_BEfunc::getRecord('pages', $this->pageinfo['pid']); // Checking the permissions for the user with regard to the parent page: Can he create new pages, new content record, new page after? if ($BE_USER->doesUserHaveAccess($this->pageinfo, 8)) { $this->newPagesInto = 1; } if ($BE_USER->doesUserHaveAccess($this->pageinfo, 16)) { $this->newContentInto = 1; } if (($BE_USER->isAdmin() || is_array($this->pidInfo)) && $BE_USER->doesUserHaveAccess($this->pidInfo, 8)) { $this->newPagesAfter = 1; } } elseif ($BE_USER->isAdmin()) { // Admins can do it all $this->newPagesInto = 1; $this->newContentInto = 1; $this->newPagesAfter = 0; } else { // People with no permission can do nothing $this->newPagesInto = 0; $this->newContentInto = 0; $this->newPagesAfter = 0; } }
/** * Rendering the quick-edit view. * * @return void */ function renderQuickEdit() { global $LANG, $BE_USER, $BACK_PATH; // Alternative template $this->doc->setModuleTemplate('templates/db_layout_quickedit.html'); // Alternative form tag; Quick Edit submits its content to tce_db.php. $this->doc->form = '<form action="' . htmlspecialchars($BACK_PATH . 'tce_db.php?&prErr=1&uPT=1') . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">'; // Setting up the context sensitive menu: $this->doc->getContextMenuCode(); // Set the edit_record value for internal use in this function: $edit_record = $this->edit_record; // If a command to edit all records in a column is issue, then select all those elements, and redirect to alt_doc.php: if (substr($edit_record, 0, 9) == '_EDIT_COL') { $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'pid=' . intval($this->id) . ' AND colPos=' . intval(substr($edit_record, 10)) . ' AND sys_language_uid=' . intval($this->current_sys_language) . ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : t3lib_BEfunc::BEenableFields('tt_content')) . t3lib_BEfunc::deleteClause('tt_content') . t3lib_BEfunc::versioningPlaceholderClause('tt_content'), '', 'sorting'); $idListA = array(); while ($cRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $idListA[] = $cRow['uid']; } $url = $BACK_PATH . 'alt_doc.php?edit[tt_content][' . implode(',', $idListA) . ']=edit&returnUrl=' . rawurlencode($this->local_linkThisScript(array('edit_record' => ''))); t3lib_utility_Http::redirect($url); } // If the former record edited was the creation of a NEW record, this will look up the created records uid: if ($this->new_unique_uid) { $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_log', 'userid=' . intval($BE_USER->user['uid']) . ' AND NEWid=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->new_unique_uid, 'sys_log')); $sys_log_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); if (is_array($sys_log_row)) { $edit_record = $sys_log_row['tablename'] . ':' . $sys_log_row['recuid']; } } // Creating the selector box, allowing the user to select which element to edit: $opt = array(); $is_selected = 0; $languageOverlayRecord = ''; if ($this->current_sys_language) { list($languageOverlayRecord) = t3lib_BEfunc::getRecordsByField('pages_language_overlay', 'pid', $this->id, 'AND sys_language_uid=' . intval($this->current_sys_language)); } if (is_array($languageOverlayRecord)) { $inValue = 'pages_language_overlay:' . $languageOverlayRecord['uid']; $is_selected += intval($edit_record == $inValue); $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $LANG->getLL('editLanguageHeader', 1) . ' ]</option>'; } else { $inValue = 'pages:' . $this->id; $is_selected += intval($edit_record == $inValue); $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $LANG->getLL('editPageProperties', 1) . ' ]</option>'; } // Selecting all content elements from this language and allowed colPos: $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'pid=' . intval($this->id) . ' AND sys_language_uid=' . intval($this->current_sys_language) . ' AND colPos IN (' . $this->colPosList . ')' . ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : t3lib_BEfunc::BEenableFields('tt_content')) . t3lib_Befunc::deleteClause('tt_content') . t3lib_BEfunc::versioningPlaceholderClause('tt_content'), '', 'colPos,sorting'); $colPos = ''; $first = 1; $prev = $this->id; // Page is the pid if no record to put this after. while ($cRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { t3lib_BEfunc::workspaceOL('tt_content', $cRow); if (is_array($cRow)) { if ($first) { if (!$edit_record) { $edit_record = 'tt_content:' . $cRow['uid']; } $first = 0; } if (strcmp($cRow['colPos'], $colPos)) { $colPos = $cRow['colPos']; $opt[] = '<option value=""></option>'; $opt[] = '<option value="_EDIT_COL:' . $colPos . '">__' . $LANG->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'colPos', $colPos), 1) . ':__</option>'; } $inValue = 'tt_content:' . $cRow['uid']; $is_selected += intval($edit_record == $inValue); $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($cRow['header'] ? $cRow['header'] : '[' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.no_title') . '] ' . strip_tags($cRow['bodytext']), $BE_USER->uc['titleLen'])) . '</option>'; $prev = -$cRow['uid']; } } // If edit_record is not set (meaning, no content elements was found for this language) we simply set it to create a new element: if (!$edit_record) { $edit_record = 'tt_content:new/' . $prev . '/' . $colPos; $inValue = 'tt_content:new/' . $prev . '/' . $colPos; $is_selected += intval($edit_record == $inValue); $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $LANG->getLL('newLabel', 1) . ' ]</option>'; } // If none is yet selected... if (!$is_selected) { $opt[] = '<option value=""></option>'; $opt[] = '<option value="' . $edit_record . '" selected="selected">[ ' . $LANG->getLL('newLabel', 1) . ' ]</option>'; } // Splitting the edit-record cmd value into table/uid: $this->eRParts = explode(':', $edit_record); // Delete-button flag? $this->deleteButton = t3lib_div::testInt($this->eRParts[1]) && $edit_record && ($this->eRParts[0] != 'pages' && $this->EDIT_CONTENT || $this->eRParts[0] == 'pages' && $this->CALC_PERMS & 4); // If undo-button should be rendered (depends on available items in sys_history) $this->undoButton = 0; $undoRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp', 'sys_history', 'tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->eRParts[0], 'sys_history') . ' AND recuid=' . intval($this->eRParts[1]), '', 'tstamp DESC', '1'); if ($this->undoButtonR = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($undoRes)) { $this->undoButton = 1; } // Setting up the Return URL for coming back to THIS script (if links take the user to another script) $R_URL_parts = parse_url(t3lib_div::getIndpEnv('REQUEST_URI')); $R_URL_getvars = t3lib_div::_GET(); unset($R_URL_getvars['popView']); unset($R_URL_getvars['new_unique_uid']); $R_URL_getvars['edit_record'] = $edit_record; $this->R_URI = $R_URL_parts['path'] . '?' . t3lib_div::implodeArrayForUrl('', $R_URL_getvars); // Setting close url/return url for exiting this script: $this->closeUrl = $this->local_linkThisScript(array('SET' => array('function' => 1))); // Goes to 'Columns' view if close is pressed (default) if ($BE_USER->uc['condensedMode']) { $this->closeUrl = $BACK_PATH . 'alt_db_navframe.php'; } if ($this->returnUrl) { $this->closeUrl = $this->returnUrl; } // Return-url for JavaScript: $retUrlStr = $this->returnUrl ? "+'&returnUrl='+'" . rawurlencode($this->returnUrl) . "'" : ''; // Drawing the edit record selectbox $this->editSelect = '<select name="edit_record" onchange="' . htmlspecialchars('jumpToUrl(\'db_layout.php?id=' . $this->id . '&edit_record=\'+escape(this.options[this.selectedIndex].value)' . $retUrlStr . ',this);') . '">' . implode('', $opt) . '</select>'; // Creating editing form: if ($BE_USER->check('tables_modify', $this->eRParts[0]) && $edit_record && ($this->eRParts[0] != 'pages' && $this->EDIT_CONTENT || $this->eRParts[0] == 'pages' && $this->CALC_PERMS & 1)) { // Splitting uid parts for special features, if new: list($uidVal, $ex_pid, $ex_colPos) = explode('/', $this->eRParts[1]); // Convert $uidVal to workspace version if any: if ($uidVal != 'new') { if ($draftRecord = t3lib_BEfunc::getWorkspaceVersionOfRecord($GLOBALS['BE_USER']->workspace, $this->eRParts[0], $uidVal, 'uid')) { $uidVal = $draftRecord['uid']; } } // Initializing transfer-data object: $trData = t3lib_div::makeInstance('t3lib_transferData'); $trData->addRawData = TRUE; $trData->defVals[$this->eRParts[0]] = array('colPos' => intval($ex_colPos), 'sys_language_uid' => intval($this->current_sys_language)); $trData->disableRTE = $this->MOD_SETTINGS['disableRTE']; $trData->lockRecords = 1; $trData->fetchRecord($this->eRParts[0], $uidVal == 'new' ? $this->id : $uidVal, $uidVal); // 'new' // Getting/Making the record: reset($trData->regTableItems_data); $rec = current($trData->regTableItems_data); if ($uidVal == 'new') { $new_unique_uid = uniqid('NEW'); $rec['uid'] = $new_unique_uid; $rec['pid'] = intval($ex_pid) ? intval($ex_pid) : $this->id; $recordAccess = TRUE; } else { $rec['uid'] = $uidVal; // Checking internals access: $recordAccess = $BE_USER->recordEditAccessInternals($this->eRParts[0], $uidVal); } if (!$recordAccess) { // If no edit access, print error message: $content .= $this->doc->section($LANG->getLL('noAccess'), $LANG->getLL('noAccess_msg') . '<br /><br />' . ($BE_USER->errorMsg ? 'Reason: ' . $BE_USER->errorMsg . '<br /><br />' : ''), 0, 1); } elseif (is_array($rec)) { // If the record is an array (which it will always be... :-) // Create instance of TCEforms, setting defaults: $tceforms = t3lib_div::makeInstance('t3lib_TCEforms'); $tceforms->backPath = $BACK_PATH; $tceforms->initDefaultBEMode(); $tceforms->fieldOrder = $this->modTSconfig['properties']['tt_content.']['fieldOrder']; $tceforms->palettesCollapsed = !$this->MOD_SETTINGS['showPalettes']; $tceforms->disableRTE = $this->MOD_SETTINGS['disableRTE']; $tceforms->enableClickMenu = TRUE; // Clipboard is initialized: $tceforms->clipObj = t3lib_div::makeInstance('t3lib_clipboard'); // Start clipboard $tceforms->clipObj->initializeClipboard(); // Initialize - reads the clipboard content from the user session if ($BE_USER->uc['edit_showFieldHelp'] != 'text' && $this->MOD_SETTINGS['showDescriptions']) { $tceforms->edit_showFieldHelp = 'text'; } // Render form, wrap it: $panel = ''; $panel .= $tceforms->getMainFields($this->eRParts[0], $rec); $panel = $tceforms->wrapTotal($panel, $rec, $this->eRParts[0]); // Add hidden fields: $theCode = $panel; if ($uidVal == 'new') { $theCode .= '<input type="hidden" name="data[' . $this->eRParts[0] . '][' . $rec['uid'] . '][pid]" value="' . $rec['pid'] . '" />'; } $theCode .= ' <input type="hidden" name="_serialNumber" value="' . md5(microtime()) . '" /> <input type="hidden" name="_disableRTE" value="' . $tceforms->disableRTE . '" /> <input type="hidden" name="edit_record" value="' . $edit_record . '" /> <input type="hidden" name="redirect" value="' . htmlspecialchars($uidVal == 'new' ? t3lib_extMgm::extRelPath('cms') . 'layout/db_layout.php?id=' . $this->id . '&new_unique_uid=' . $new_unique_uid . '&returnUrl=' . rawurlencode($this->returnUrl) : $this->R_URI) . '" /> ' . t3lib_TCEforms::getHiddenTokenField('tceAction'); // Add JavaScript as needed around the form: $theCode = $tceforms->printNeededJSFunctions_top() . $theCode . $tceforms->printNeededJSFunctions(); // Add warning sign if record was "locked": if ($lockInfo = t3lib_BEfunc::isRecordLocked($this->eRParts[0], $rec['uid'])) { $lockedMessage = t3lib_div::makeInstance('t3lib_FlashMessage', htmlspecialchars($lockInfo['msg']), '', t3lib_FlashMessage::WARNING); t3lib_FlashMessageQueue::addMessage($lockedMessage); } // Add whole form as a document section: $content .= $this->doc->section('', $theCode); } } else { // If no edit access, print error message: $content .= $this->doc->section($LANG->getLL('noAccess'), $LANG->getLL('noAccess_msg') . '<br /><br />', 0, 1); } // Bottom controls (function menus): $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', 1)) : $LANG->getLL('hiddenCE', 1) . ' (' . $q_count . ')') . '</label>'; $h_func_b .= '<br />' . t3lib_BEfunc::getFuncCheck($this->id, 'SET[showPalettes]', $this->MOD_SETTINGS['showPalettes'], 'db_layout.php', '', 'id="checkShowPalettes"') . '<label for="checkShowPalettes">' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPalettes', 1) . '</label>'; if (t3lib_extMgm::isLoaded('context_help') && $BE_USER->uc['edit_showFieldHelp'] != 'text') { $h_func_b .= '<br />' . t3lib_BEfunc::getFuncCheck($this->id, 'SET[showDescriptions]', $this->MOD_SETTINGS['showDescriptions'], 'db_layout.php', '', 'id="checkShowDescriptions"') . '<label for="checkShowDescriptions">' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showDescriptions', 1) . '</label>'; } if ($BE_USER->isRTE()) { $h_func_b .= '<br />' . t3lib_BEfunc::getFuncCheck($this->id, 'SET[disableRTE]', $this->MOD_SETTINGS['disableRTE'], 'db_layout.php', '', 'id="checkDisableRTE"') . '<label for="checkDisableRTE">' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.disableRTE', 1) . '</label>'; } // Add the function menus to bottom: $content .= $this->doc->section('', $h_func_b, 0, 0); $content .= $this->doc->spacer(10); // Select element matrix: if ($this->eRParts[0] == 'tt_content' && t3lib_div::testInt($this->eRParts[1])) { $posMap = t3lib_div::makeInstance('ext_posMap'); $posMap->backPath = $BACK_PATH; $posMap->cur_sys_language = $this->current_sys_language; $HTMLcode = ''; // CSH: $HTMLcode .= t3lib_BEfunc::cshItem($this->descrTable, 'quickEdit_selElement', $BACK_PATH, '|<br />'); $HTMLcode .= $posMap->printContentElementColumns($this->id, $this->eRParts[1], $this->colPosList, $this->MOD_SETTINGS['tt_content_showHidden'], $this->R_URI); $content .= $this->doc->spacer(20); $content .= $this->doc->section($LANG->getLL('CEonThisPage'), $HTMLcode, 0, 1); $content .= $this->doc->spacer(20); } // Finally, if comments were generated in TCEforms object, print these as a HTML comment: if (count($tceforms->commentMessages)) { $content .= ' <!-- TCEFORM messages ' . htmlspecialchars(implode(LF, $tceforms->commentMessages)) . ' --> '; } return $content; }