本文整理汇总了PHP中t3lib_div::linkThisScript方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_div::linkThisScript方法的具体用法?PHP t3lib_div::linkThisScript怎么用?PHP t3lib_div::linkThisScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_div
的用法示例。
在下文中一共展示了t3lib_div::linkThisScript方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* Main function, returning the HTML content of the module
*
* @return string HTML
*/
function main() {
require_once(t3lib_extMgm::extPath(STATIC_INFO_TABLES_EXTkey).'class.tx_staticinfotables_encoding.php');
$tableArray = array ('static_countries', 'static_country_zones', 'static_languages', 'static_currencies');
$content = '';
$content.= '<br />Convert character encoding of the static info tables.';
$content.= '<br />The default encoding is UTF-8.';
$destEncoding = htmlspecialchars(t3lib_div::_GP('dest_encoding'));
if(t3lib_div::_GP('convert') AND ($destEncoding != '')) {
foreach ($tableArray as $table) {
$content .= '<p>'.htmlspecialchars($table.' > '.$destEncoding).'</p>';
tx_staticinfotables_encoding::convertEncodingTable($table, 'utf-8', $destEncoding);
}
$content .= '<p>You must enter the charset \''.$destEncoding.'\' now manually in the EM for static_info_tables!</p>';
$content .= '<p>Done</p>';
} else {
$content .= '<form name="static_info_tables_form" action="'.htmlspecialchars(t3lib_div::linkThisScript()).'" method="post">';
$linkScript = t3lib_div::slashJS(t3lib_div::linkThisScript());
$content .= '<br /><br />';
$content .= 'This conversion works only once. When you converted the tables and you want to do it again to another encoding you have to reinstall the tables with the Extension Manager or select \'UPDATE!\'.';
$content .= '<br /><br />';
$content .= 'Destination character encoding:';
$content .= '<br />'.tx_staticinfotables_encoding::getEncodingSelect('dest_encoding', '', '', $TYPO3_CONF_VARS['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['charset']);
$content .= '<br /><br />';
$content .= '<input type="submit" name="convert" value="Convert" onclick="this.form.action=\''.$linkScript.'\';submit();" />';
$content .= '</form>';
}
return $content;
}
示例2: main
/**
* Main function, returning the HTML content of the module
*
* @return string HTML
*/
function main()
{
$content = '';
$content .= '<p>Following functions modify the database which might be needed due to changed default behaviour of content elements.</p>';
$updateAction = t3lib_div::_GP('updateAction');
if ($updateAction === 'do_imagecaption_position_hidden') {
$updateContent = $this->perform_update_tt_content_imagecaption_position('hidden');
}
if ($updateAction === 'do_imagecaption_position_default') {
$updateContent = $this->perform_update_tt_content_imagecaption_position('default');
}
if ($updateContent) {
$content .= '<div class="bgColor5" style="margin:2em 0 1em 0; padding: 0.5em; border:1px solid #aaa">' . $updateContent . '</div>';
}
//
// captions
//
$onClickHidden = "document.location.href='" . t3lib_div::linkThisScript(array('updateAction' => 'do_imagecaption_position_hidden')) . "'; return false;";
$onClickVisible = "document.location.href='" . t3lib_div::linkThisScript(array('updateAction' => 'do_imagecaption_position_default')) . "'; return false;";
$content .= '<br /><h3>Image caption display</h3>
<p>When css_styled_content is used for rendering, this extension can change the rendering so captions can be fetched from DAM for the content elements Image and Text w/image (see extension options).</p>
<p>Captions might be visible now (coming from DAM) where no captions were needed. With the following functions...</p>
<ul>
<li>all unused captions can be set hidden</li>
<li>all hidden captions can be set visible again</li>
</ul>
<input onclick="' . htmlspecialchars($onClickHidden) . '" type="submit" value="Set unused captions hidden"> ' . '<input onclick="' . htmlspecialchars($onClickVisible) . '" type="submit" value="unhide captions"></form>
';
return $content;
}
示例3: main
/**
* Main function
*
* @param [type] $$backRef: ...
* @param [type] $menuItems: ...
* @param [type] $table: ...
* @param [type] $uid: ...
* @return [type] ...
*/
function main(&$backRef, $menuItems, $table, $uid)
{
global $BE_USER, $TCA, $LANG;
$localItems = array();
if (!$backRef->cmLevel) {
// Returns directly, because the clicked item was not from the pages table
if ($table == "tx_l10nmgr_cfg") {
// Adds the regular item:
$LL = $this->includeLL();
// Repeat this (below) for as many items you want to add!
// Remember to add entries in the localconf.php file for additional titles.
$url = t3lib_extMgm::extRelPath("l10nmgr") . "cm1/index.php?id=" . $uid;
$localItems[] = $backRef->linkItem($GLOBALS["LANG"]->getLLL("cm1_title", $LL), $backRef->excludeIcon('<img src="' . t3lib_extMgm::extRelPath("l10nmgr") . 'cm1/cm_icon.gif" width="15" height="12" border="0" align="top" />'), $backRef->urlRefForCM($url), 1);
}
$localItems["moreoptions_tx_l10nmgr_cm3"] = $backRef->linkItem('L10Nmgr tools', '', "top.loadTopMenu('" . t3lib_div::linkThisScript() . "&cmLevel=1&subname=moreoptions_tx_l10nmgrXX_cm3');return false;", 0, 1);
// Simply merges the two arrays together and returns ...
$menuItems = array_merge($menuItems, $localItems);
} elseif (t3lib_div::_GET('subname') == 'moreoptions_tx_l10nmgrXX_cm3') {
$url = t3lib_extMgm::extRelPath("l10nmgr") . "cm3/index.php?id=" . $uid . '&table=' . $table;
$localItems[] = $backRef->linkItem('Create priority', '', $backRef->urlRefForCM($url . '&cmd=createPriority'), 1);
$localItems[] = $backRef->linkItem('Manage priorities', '', $backRef->urlRefForCM($url . '&cmd=managePriorities'), 1);
$localItems[] = $backRef->linkItem('Update Index', '', $backRef->urlRefForCM($url . '&cmd=updateIndex'), 1);
$localItems[] = $backRef->linkItem('Flush Translations', '', $backRef->urlRefForCM($url . '&cmd=flushTranslations'), 1);
$menuItems = array_merge($menuItems, $localItems);
}
return $menuItems;
}
示例4: main
/**
* Main function, returning the HTML content of the module
*
* @return string HTML
*/
function main()
{
$content = '';
$content .= '<br />Update the Static Info Tables with new language labels.';
$content .= '<br />';
if (t3lib_div::_GP('import')) {
$destEncoding = t3lib_div::_GP('dest_encoding');
$extPath = t3lib_extMgm::extPath('static_info_tables_it');
$fileContent = explode("\n", t3lib_div::getUrl($extPath . 'ext_tables_static_update.sql'));
foreach ($fileContent as $line) {
if ($line = trim($line) and preg_match('#^UPDATE#i', $line)) {
$query = $this->getUpdateEncoded($line, $destEncoding);
$res = $GLOBALS['TYPO3_DB']->admin_query($query);
}
}
$content .= '<br />';
$content .= '<p>Encoding: ' . htmlspecialchars($destEncoding) . '</p>';
$content .= '<p>Done.</p>';
} elseif (t3lib_extMgm::isLoaded('static_info_tables_it')) {
$content .= '</form>';
$content .= '<form action="' . htmlspecialchars(t3lib_div::linkThisScript()) . '" method="post">';
$content .= '<br />Destination character encoding:';
$content .= '<br />' . tx_staticinfotables_encoding::getEncodingSelect('dest_encoding', '', 'utf-8');
$content .= '<br />(The character encoding must match the encoding of the existing tables data. By default this is UTF-8.)';
$content .= '<br /><br />';
$content .= '<input type="submit" name="import" value="Import" />';
$content .= '</form>';
} else {
$content .= '<br /><strong>The extension needs to be installed first!</strong>';
}
return $content;
}
示例5: main
/**
* Main function, returning the HTML content of the module
*
* @return string HTML
*/
function main()
{
if (!t3lib_div::_GP('do_update')) {
$onClick = "document.location.href='" . t3lib_div::linkThisScript(array('do_update' => 1)) . "'; return false;";
return 'Do you want to perform the database update now?
<form action=""><input type="submit" value="DO IT" onclick="' . htmlspecialchars($onClick) . '"></form>
';
} else {
return $this->perform_update();
}
}
示例6: main
/**
* Main function, returning the HTML content of the update module
*
* @return string HTML
*/
function main()
{
$fieldsets = array();
$fieldsets['Character encoding'] = $this->getDestEncodingSelect();
$fieldsets['Update Static Info Tables'] = $this->handleUpdateStaticInfoTables();
$content = '';
$content .= '<form action="' . htmlspecialchars(t3lib_div::linkThisScript()) . '" method="post">';
foreach ($fieldsets as $legend => $fieldset) {
$content .= '<fieldset>';
if ($legend && !is_numeric($legend)) {
$content .= '<legend><strong> ' . $legend . ' </strong></legend>';
}
$content .= $fieldset;
$content .= '</fieldset>';
$content .= '<p><br /></p>';
}
$content .= '<p><input type="submit" /></p>';
$content .= '</form>';
return $content;
}
示例7: ext_getForm
/**
* Get the form for extension configuration
*
* @param string $cat
* @param array $theConstants
* @param string $script
* @param string $addFields
* @param string $extKey
* @param bool Adds opening <form> tag to the ouput, if TRUE
* @return string the form
*/
function ext_getForm($cat, $theConstants, $script = "", $addFields = "", $extKey = "", $addFormTag = TRUE)
{
$this->ext_makeHelpInformationForCategory($cat);
$printFields = trim($this->ext_printFields($theConstants, $cat));
$content = '';
$content .= t3lib_div::wrapJS('
function uFormUrl(aname) {
document.' . $this->ext_CEformName . '.action = "' . t3lib_div::linkThisScript() . '#"+aname;
}
');
if ($addFormTag) {
$content .= '<form action="' . htmlspecialchars($script ? $script : t3lib_div::linkThisScript()) . '" name="' . $this->ext_CEformName . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '">';
}
$content .= $addFields;
$content .= $printFields;
$content .= '<input type="submit" name="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tsfe.xml:update', TRUE) . '" id="configuration-submit-' . htmlspecialchars($extKey) . '" />';
$example = $this->ext_displayExample();
$content .= $example ? '<hr/>' . $example : "";
return $content;
}
示例8: main_mode
/**
* Main function of the MODULE. Write the content to $this->content
* There are three main modes:
* - Based on a file reference, creating/modifying a DS/TO
* - Based on a Template Object uid, remapping
* - Based on a Data Structure uid, selecting a Template Object to map.
*
* @return void
*/
function main_mode()
{
global $LANG, $BACK_PATH;
// Draw the header.
$this->doc = t3lib_div::makeInstance('noDoc');
$this->doc->backPath = $BACK_PATH;
$this->doc->docType = 'xhtml_trans';
$this->doc->inDocStylesArray[] = '
DIV.typo3-noDoc { width: 98%; margin: 0 0 0 0; }
DIV.typo3-noDoc H2 { width: 100%; }
TABLE#c-mapInfo {margin-top: 10px; margin-bottom: 5px; }
TABLE#c-mapInfo TR TD {padding-right: 20px;}
';
// General GPvars for module mode:
$this->displayFile = t3lib_div::GPvar('file');
$this->displayTable = t3lib_div::GPvar('table');
$this->displayUid = t3lib_div::GPvar('uid');
$this->displayPath = t3lib_div::GPvar('htmlPath');
$this->returnUrl = t3lib_div::GPvar('returnUrl');
// GPvars specific to the DS listing/table and mapping features:
$this->_preview = t3lib_div::GPvar('_preview');
$this->mapElPath = t3lib_div::GPvar('mapElPath');
$this->doMappingOfPath = t3lib_div::GPvar('doMappingOfPath');
$this->showPathOnly = t3lib_div::GPvar('showPathOnly');
$this->mappingToTags = t3lib_div::GPvar('mappingToTags');
$this->DS_element = t3lib_div::GPvar('DS_element');
$this->DS_cmd = t3lib_div::GPvar('DS_cmd');
$this->fieldName = t3lib_div::GPvar('fieldName');
// GPvars specific for DS creation from a file.
$this->_load_ds_xml_content = t3lib_div::GPvar('_load_ds_xml_content');
$this->_load_ds_xml_to = t3lib_div::GPvar('_load_ds_xml_to');
$this->_saveDSandTO_TOuid = t3lib_div::GPvar('_saveDSandTO_TOuid');
$this->_saveDSandTO_title = t3lib_div::GPvar('_saveDSandTO_title');
$this->_saveDSandTO_type = t3lib_div::GPvar('_saveDSandTO_type');
$this->_saveDSandTO_pid = t3lib_div::GPvar('_saveDSandTO_pid');
$this->DS_element_DELETE = t3lib_div::GPvar('DS_element_DELETE');
// Finding Storage folder:
$this->findingStorageFolderIds();
// Setting up form-wrapper:
$this->doc->form = '<form action="' . $this->linkThisScript(array()) . '" method="post" name="pageform">';
// JavaScript
$this->doc->JScode .= $this->doc->wrapScriptTags('
script_ended = 0;
function jumpToUrl(URL) { //
document.location = URL;
}
function updPath(inPath) { //
document.location = "' . t3lib_div::linkThisScript(array('htmlPath' => '', 'doMappingOfPath' => 1)) . '&htmlPath="+top.rawurlencode(inPath);
}
') . $this->doc->getDynTabMenuJScode();
// Setting up the context sensitive menu:
$CMparts = $this->doc->getContextMenuCode();
$this->doc->bodyTagAdditions = $CMparts[1];
$this->doc->JScode .= $CMparts[0];
$this->doc->postCode .= $CMparts[2];
$this->content .= $this->doc->startPage($LANG->getLL('title'));
$this->content .= $this->doc->header($LANG->getLL('title'));
$this->content .= $this->doc->spacer(5);
if ($this->returnUrl) {
$this->content .= '<a href="' . htmlspecialchars($this->returnUrl) . '" class="typo3-goBack">' . '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/goback.gif', 'width="14" height="14"') . ' alt="" />' . $LANG->sL('LLL:EXT:lang/locallang_misc.xml:goBack', 1) . '</a><br/>';
}
// Render content, depending on input values:
if ($this->displayFile) {
// Browsing file directly, possibly creating a template/data object records.
$this->renderFile();
} elseif ($this->displayTable == 'tx_templavoila_datastructure') {
// Data source display
$this->renderDSO();
} elseif ($this->displayTable == 'tx_templavoila_tmplobj') {
// Data source display
$this->renderTO();
}
// Add spacer:
$this->content .= $this->doc->spacer(10);
}
示例9: getFormTag
/**
* Returns a form tag with the current configured params
*
* @param string $name Name of the form tag
* @return string HTML form tag
*/
function getFormTag($name = 'editform')
{
global $TYPO3_CONF_VARS;
$addParams = $this->addParams ? $this->addParams : array();
$formAction = t3lib_div::linkThisScript($addParams);
return '<form action="' . htmlspecialchars($formAction) . '" method="post" name="' . $name . '" id="' . $name . '" autocomplete="off" enctype="' . $TYPO3_CONF_VARS['SYS']['form_enctype'] . '">';
}
示例10: printTable
/**
* Creates a table of properties:
*
* @param array Array with properties for the current object path
* @param string Object path
* @param array Object tree
* @return string HTML content.
*/
function printTable($table, $objString, $objTree)
{
if (is_array($table['rows'])) {
// Initialize:
$lines = array();
// Adding header:
$lines[] = '
<tr class="t3-row-header">
<td>Property:</td>
<td>Data type:</td>
<td>Description:</td>
<td>Default:</td>
</tr>';
// Traverse the content of "rows":
foreach ($table['rows'] as $i => $row) {
// Linking:
$lP = t3lib_div::trimExplode(LF, $row['property'], 1);
$lP2 = array();
foreach ($lP as $k => $lStr) {
$lP2[$k] = $this->linkProperty($lStr, $lStr, $objString, $row['datatype']);
}
$linkedProperties = implode('<hr />', $lP2);
// Data type:
$dataType = $row['datatype'];
// Generally "->[something]"
$reg = array();
preg_match('/->[[:alnum:]_]*/', $dataType, $reg);
if ($reg[0] && is_array($objTree[$reg[0]])) {
$dataType = str_replace($reg[0], '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('show' => $objTree[$reg[0]][0]['uid'], 'objString' => $objString . '.' . $lP[0]))) . '">' . htmlspecialchars($reg[0]) . '</a>', $dataType);
}
// stdWrap
if (!strstr($dataType, '->stdWrap') && strstr(strip_tags($dataType), 'stdWrap')) {
// Potential problem can be that "stdWrap" is substituted inside another A-tag. So maybe we should even check if there is already a <A>-tag present and if so, not make a substitution?
$dataType = str_replace('stdWrap', '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('show' => $objTree['->stdWrap'][0]['uid'], 'objString' => $objString . '.' . $lP[0]))) . '">stdWrap</a>', $dataType);
}
$lines[] = '
<tr class="t3-row ' . ($i % 2 ? 't3-row-even' : 't3-row-odd') . '">
<td valign="top" class="bgColor4-20" nowrap="nowrap"><strong>' . $linkedProperties . '</strong></td>
<td valign="top">' . nl2br($dataType . ' ') . '</td>
<td valign="top">' . nl2br($row['description']) . '</td>
<td valign="top">' . nl2br($row['default']) . '</td>
</tr>';
}
// Return it all:
return '
<!--
TSconfig, attribute selector:
-->
<table border="0" cellpadding="0" cellspacing="1" width="98%" class="t3-table" id="typo3-attributes">
' . implode('', $lines) . '
</table>';
}
}
示例11: linkRTEbutton
/**
* Adds a button to edit the row in RTE wizard
*
* @param array The row of tt_content element
* @return string Button to click if you want to edit in RTE wizard.
*/
function linkRTEbutton($row)
{
$params = array();
$params['table'] = 'tt_content';
$params['uid'] = $row['uid'];
$params['pid'] = $row['pid'];
$params['field'] = 'bodytext';
$params['returnUrl'] = t3lib_div::linkThisScript();
$RTEonClick = "window.location.href='" . $this->backPath . "wizard_rte.php?" . t3lib_div::implodeArrayForUrl('', array('P' => $params)) . "';return false;";
$addButton = $this->option_showBigButtons && $this->doEdit ? $GLOBALS['SOBE']->doc->t3Button($RTEonClick, $GLOBALS['LANG']->getLL('editInRTE')) : '';
return $addButton;
}
示例12: resultRowDisplay
/**
* [Describe function...]
*
* @param [type] $row: ...
* @param [type] $conf: ...
* @param [type] $table: ...
* @return [type] ...
*/
function resultRowDisplay($row, $conf, $table)
{
static $even = FALSE;
$tce = t3lib_div::makeInstance('t3lib_TCEmain');
$SET = $GLOBALS['SOBE']->MOD_SETTINGS;
$out = '<tr class="bgColor' . ($even ? '6' : '4') . '">';
$even = !$even;
foreach ($row as $fN => $fV) {
if (t3lib_div::inList($SET['queryFields'], $fN) || !$SET['queryFields'] && $fN != 'pid' && $fN != 'deleted') {
if ($SET['search_result_labels']) {
$fVnew = $this->getProcessedValueExtra($table, $fN, $fV, $conf, '<br />');
} else {
$fVnew = htmlspecialchars($fV);
}
$out .= '<td>' . $fVnew . '</td>';
}
}
$params = '&edit[' . $table . '][' . $row['uid'] . ']=edit';
$out .= '<td nowrap>';
if (!$row['deleted']) {
$out .= '<a href="#" onClick="top.launchView(\'' . $table . '\',' . $row['uid'] . ',\'' . $GLOBALS['BACK_PATH'] . '\');return false;">' . t3lib_iconWorks::getSpriteIcon('status-dialog-information') . '</a>';
$out .= '<a href="#" onClick="' . t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], t3lib_div::getIndpEnv('REQUEST_URI') . t3lib_div::implodeArrayForUrl('SET', (array) t3lib_div::_POST('SET'))) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
} else {
$out .= '<a href="' . t3lib_div::linkThisUrl($GLOBALS['BACK_PATH'] . 'tce_db.php', array('cmd[' . $table . '][' . $row['uid'] . '][undelete]' => '1', 'redirect' => t3lib_div::linkThisScript(array()))) . t3lib_BEfunc::getUrlToken('tceAction') . '">';
$out .= t3lib_iconWorks::getSpriteIcon('actions-edit-restore', array('title' => 'undelete only')) . '</a>';
$out .= '<a href="' . t3lib_div::linkThisUrl($GLOBALS['BACK_PATH'] . 'tce_db.php', array('cmd[' . $table . '][' . $row['uid'] . '][undelete]' => '1', 'redirect' => t3lib_div::linkThisUrl('alt_doc.php', array('edit[' . $table . '][' . $row['uid'] . ']' => 'edit', 'returnUrl' => t3lib_div::linkThisScript(array()))))) . t3lib_BEfunc::getUrlToken('tceAction') . '">';
$out .= t3lib_iconWorks::getSpriteIcon('actions-edit-restore-edit', array('title' => 'undelete and edit')) . '</a>';
}
$_params = array($table => $row);
if (is_array($this->hookArray['additionalButtons'])) {
foreach ($this->hookArray['additionalButtons'] as $_funcRef) {
$out .= t3lib_div::callUserFunction($_funcRef, $_params, $this);
}
}
$out .= '</td>
</tr>
';
return $out;
}
示例13: localFolderTree
/**
* Initializes the script path
*
* @return void
*/
function localFolderTree()
{
$this->thisScript = t3lib_div::linkThisScript();
$this->t3lib_folderTree();
}
示例14: getVersionSelector
/**
* Creates the version selector for the page id inputted.
* Requires the core version management extension, "version" to be loaded.
*
* @param integer Page id to create selector for.
* @param boolean If set, there will be no button for swapping page.
* @return void
*/
function getVersionSelector($id, $noAction = FALSE)
{
if ($id > 0) {
if (t3lib_extMgm::isLoaded('version') && $GLOBALS['BE_USER']->workspace == 0) {
// Get Current page record:
$curPage = t3lib_BEfunc::getRecord('pages', $id);
// If the selected page is not online, find the right ID
$onlineId = $curPage['pid'] == -1 ? $curPage['t3ver_oid'] : $id;
// Select all versions of online version:
$versions = t3lib_BEfunc::selectVersionsOfRecord('pages', $onlineId, 'uid,pid,t3ver_label,t3ver_oid,t3ver_wsid,t3ver_id');
// If more than one was found...:
if (count($versions) > 1) {
$selectorLabel = '<strong>' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xml:versionSelect.label', TRUE) . '</strong>';
// Create selector box entries:
$opt = array();
foreach ($versions as $vRow) {
if ($vRow['uid'] == $onlineId) {
//Live version
$label = '[' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xml:versionSelect.live', TRUE) . ']';
} else {
$label = $vRow['t3ver_label'] . ' (' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xml:versionId', TRUE) . ' ' . $vRow['t3ver_id'] . ($vRow['t3ver_wsid'] != 0 ? ' ' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xml:workspaceId', TRUE) . ' ' . $vRow['t3ver_wsid'] : '') . ')';
}
$opt[] = '<option value="' . htmlspecialchars(t3lib_div::linkThisScript(array('id' => $vRow['uid']))) . '"' . ($id == $vRow['uid'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>';
}
// Add management link:
$management = '<input type="button" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:ver.mgm', TRUE) . '" onclick="window.location.href=\'' . htmlspecialchars($this->backPath . t3lib_extMgm::extRelPath('version') . 'cm1/index.php?table=pages&uid=' . $onlineId) . '\';" />';
// Create onchange handler:
$onChange = "window.location.href=this.options[this.selectedIndex].value;";
// Controls:
if ($id == $onlineId) {
$controls .= '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/blinkarrow_left.gif', 'width="5" height="9"') . ' class="absmiddle" alt="" /> <strong>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:ver.online', TRUE) . '</strong>';
} elseif (!$noAction) {
$controls .= '<a href="' . $this->issueCommand('&cmd[pages][' . $onlineId . '][version][swapWith]=' . $id . '&cmd[pages][' . $onlineId . '][version][action]=swap', t3lib_div::linkThisScript(array('id' => $onlineId))) . '" class="nobr">' . t3lib_iconWorks::getSpriteIcon('actions-version-swap-version', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:ver.swapPage', TRUE), 'style' => 'margin-left:5px;vertical-align:bottom;')) . '<strong>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:ver.swap', TRUE) . '</strong></a>';
}
// Write out HTML code:
return '
<!--
Version selector:
-->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-versionSelector">
<tr>
<td>' . $selectorLabel . '</td>
<td>
<select onchange="' . htmlspecialchars($onChange) . '">
' . implode('', $opt) . '
</select></td>
<td>' . $controls . '</td>
<td>' . $management . '</td>
</tr>
</table>
';
}
} elseif ($GLOBALS['BE_USER']->workspace !== 0) {
// Write out HTML code:
switch ($GLOBALS['BE_USER']->workspace) {
case 0:
$wsTitle = $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xml:live', TRUE);
break;
case -1:
$wsTitle = $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xml:draft', TRUE);
break;
default:
$wsTitle = $GLOBALS['BE_USER']->workspaceRec['title'];
break;
}
if (t3lib_BEfunc::isPidInVersionizedBranch($id) == 'branchpoint') {
return '
<!--
Version selector:
-->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-versionSelector">
<tr>
<td>' . $selectorLabel . '</td>
<td>Workspace: "' . htmlspecialchars($wsTitle) . '"</td>
<td><em>' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xml:versionSelect.inBranch', TRUE) . '</em></td>
</tr>
</table>
';
} else {
// Get Current page record:
$curPage = t3lib_BEfunc::getRecord('pages', $id);
// If the selected page is not online, find the right ID
$onlineId = $curPage['pid'] == -1 ? $curPage['t3ver_oid'] : $id;
// The version of page:
$verPage = t3lib_BEfunc::getWorkspaceVersionOfRecord($GLOBALS['BE_USER']->workspace, 'pages', $onlineId);
if (!$verPage) {
if (!count(t3lib_BEfunc::countVersionsOfRecordsOnPage($GLOBALS['BE_USER']->workspace, $onlineId))) {
if ($GLOBALS['BE_USER']->workspaceVersioningTypeAccess(0)) {
$onClick = $this->issueCommand('&cmd[pages][' . $onlineId . '][version][action]=new&cmd[pages][' . $onlineId . '][version][treeLevels]=0', t3lib_div::linkThisScript(array('id' => $onlineId)));
$onClick = 'window.location.href=\'' . $onClick . '\'; return false;';
//.........这里部分代码省略.........
示例15: reinitParams
/**
* Set some variables with the current parameters
*
* @return void
*/
function reinitParams()
{
global $TYPO3_CONF_VARS;
// needed for browsetrees and just to be save
$this->addParams = array();
$GLOBALS['SOBE']->browser->act = $GLOBALS['SOBE']->act = $this->addParams['act'] = $this->act;
$GLOBALS['SOBE']->browser->mode = $GLOBALS['SOBE']->mode = $this->addParams['mode'] = $this->mode;
$GLOBALS['SOBE']->browser->bparams = $GLOBALS['SOBE']->bparams = $this->addParams['bparams'] = $this->bparams;
$GLOBALS['SOBE']->browser->expandFolder = $GLOBALS['SOBE']->expandFolder = $this->addParams['expandFolder'] = $this->expandFolder;
$this->formTag = '<form action="' . htmlspecialchars(t3lib_div::linkThisScript($this->addParams)) . '" method="post" name="editform" enctype="' . $TYPO3_CONF_VARS['SYS']['form_enctype'] . '">';
}