Bug #23753 » 16020_dyntabmenu.patch
t3lib/class.t3lib_tceforms.php (Arbeitskopie) | ||
---|---|---|
*/
|
||
var $clipObj=FALSE;
|
||
var $enableClickMenu=FALSE; // Enable click menu on reference icons.
|
||
var $enableTabMenu = FALSE; // Enable Tab Menus. If set to true, the JavaScript content from template::getDynTabMenuJScode() must be included in the document.
|
||
var $enableTabMenu = FALSE; // Enable Tab Menus.
|
||
var $renderReadonly = FALSE; // When enabled all fields are rendered non-editable.
|
||
var $form_rowsToStylewidth = 9.58; // Form field width compensation: Factor from NN4 form field widths to style-aware browsers (like NN6+ and MSIE, with the $CLIENT[FORMSTYLE] value set)
|
||
... | ... | |
function getDynTabMenu($parts, $idString, $dividersToTabsBehaviour = 1) {
|
||
if (is_object($GLOBALS['TBE_TEMPLATE'])) {
|
||
$GLOBALS['TBE_TEMPLATE']->backPath = $this->backPath;
|
||
return $GLOBALS['TBE_TEMPLATE']->getDynTabMenu($parts, $idString, 0, false, 50, 1, false, 1, $dividersToTabsBehaviour);
|
||
return $GLOBALS['TBE_TEMPLATE']->getDynTabMenu($parts, $idString, 0, FALSE, 0, 1, FALSE, 1, $dividersToTabsBehaviour);
|
||
} else {
|
||
$output = '';
|
||
foreach($parts as $singlePad) {
|
typo3/template.php (Arbeitskopie) | ||
---|---|---|
* @param string Identification string. This should be unique for every instance of a dynamic menu!
|
||
* @param integer If "1", then enabling one tab does not hide the others - they simply toggles each sheet on/off. This makes most sense together with the $foldout option. If "-1" then it acts normally where only one tab can be active at a time BUT you can click a tab and it will close so you have no active tabs.
|
||
* @param boolean If set, the tabs are rendered as headers instead over each sheet. Effectively this means there is no tab menu, but rather a foldout/foldin menu. Make sure to set $toggle as well for this option.
|
||
* @param integer Character limit for a new row.
|
||
* @param integer Character limit for a new row, 0 by default, because this parameter is deprecated since TYPO3 4.5
|
||
* @param boolean If set, tab table cells are not allowed to wrap their content
|
||
* @param boolean If set, the tabs will span the full width of their position
|
||
* @param integer Default tab to open (for toggle <=0). Value corresponds to integer-array index + 1 (index zero is "1", index "1" is 2 etc.). A value of zero (or something non-existing) will result in no default tab open.
|
||
* @param integer If set to '1' empty tabs will be remove, If set to '2' empty tabs will be disabled
|
||
* @return string JavaScript section for the HTML header.
|
||
*/
|
||
function getDynTabMenu($menuItems,$identString,$toggle=0,$foldout=FALSE,$newRowCharLimit=50,$noWrap=1,$fullWidth=FALSE,$defaultTabIndex=1,$dividers2tabs=2) {
|
||
// load the static code, if not already done with the function below
|
||
public function getDynTabMenu($menuItems, $identString, $toggle = 0, $foldout = FALSE, $newRowCharLimit = 0, $noWrap = 1, $fullWidth = FALSE, $defaultTabIndex = 1, $dividers2tabs = 2) {
|
||
// load the static code, if not already done with the function below
|
||
$this->loadJavascriptLib('js/tabmenu.js');
|
||
$content = '';
|
||
... | ... | |
$tabRows=0;
|
||
$titleLenCount = 0;
|
||
foreach($menuItems as $index => $def) {
|
||
$index+=1; // Need to add one so checking for first index in JavaScript is different than if it is not set at all.
|
||
// Need to add one so checking for first index in JavaScript
|
||
// is different than if it is not set at all.
|
||
$index+=1;
|
||
// Switch to next tab row if needed
|
||
if (!$foldout && ($titleLenCount>$newRowCharLimit | ($def['newline'] === true && $titleLenCount > 0))) {
|
||
if (!$foldout && (($newRowCharLimit > 0 && $titleLenCount > $newRowCharLimit) | ($def['newline'] === TRUE && $titleLenCount > 0))) {
|
||
$titleLenCount=0;
|
||
$tabRows++;
|
||
$options[$tabRows] = array();
|
||
... | ... | |
$isEmpty = !(strcmp(trim($def['content']),'') || strcmp(trim($def['icon']),''));
|
||
// "Removes" empty tabs
|
||
// "Removes" empty tabs
|
||
if ($isEmpty && $dividers2tabs == 1) {
|
||
continue;
|
||
}
|
||
... | ... | |
* (as long as it is called before $this->startPage())
|
||
* The return value is not needed anymore
|
||
*
|
||
* @deprecated since TYPO3 4.5, as the getDynTabMenu() function includes the function automatically since TYPO3 4.3
|
||
* @return string JavaScript section for the HTML header. (return value is deprecated since TYPO3 4.3, will be removed in TYPO3 4.5)
|
||
*/
|
||
function getDynTabMenuJScode() {
|
||
t3lib_div::logDeprecatedFunction();
|
||
$this->loadJavascriptLib('js/tabmenu.js');
|
||
// return value deprecated since TYPO3 4.3
|
||
return '';
|
typo3/alt_doc.php (Arbeitskopie) | ||
---|---|---|
t3lib_BEfunc::viewOnClick($this->popViewId,'',t3lib_BEfunc::BEgetRootLine($this->popViewId),'',$this->viewUrl,$this->popViewId_addParams).
|
||
' } '
|
||
: '')
|
||
).$this->doc->getDynTabMenuJScode();
|
||
);
|
||
// Setting up the context sensitive menu:
|
||
$this->doc->getContextMenuCode();
|
typo3/sysext/cms/layout/db_new_content_el.php (Arbeitskopie) | ||
---|---|---|
$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:
|
||
... | ... | |
.typo3-dyntabmenu-divs table { margin: 15px; }
|
||
.typo3-dyntabmenu-divs table td { padding: 3px; }
|
||
';
|
||
$code = $LANG->getLL('sel1',1) . '<br /><br />' . $this->doc->getDynTabMenu($menuItems, 'new-content-element-wizard', false, false, 100);
|
||
$code = $LANG->getLL('sel1',1) . '<br /><br />' . $this->doc->getDynTabMenu($menuItems, 'new-content-element-wizard', FALSE, FALSE);
|
||
} else {
|
||
$code = $LANG->getLL('sel1',1) . '<br /><br />';
|
||
foreach ($menuItems as $section) {
|
typo3/sysext/version/ws/workspaceforms.php (Arbeitskopie) | ||
---|---|---|
$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();
|
||
$this->doc->JScode.= $this->doc->getDynTabMenuJScode();
|
||
// Parent initialization:
|
||
t3lib_SCbase::init();
|
typo3/sysext/version/ws/index.php (Arbeitskopie) | ||
---|---|---|
// Setting up the context sensitive menu:
|
||
$this->doc->getContextMenuCode();
|
||
// Add JS for dynamic tabs:
|
||
$this->doc->JScode.= $this->doc->getDynTabMenuJScode();
|
||
// Setting publish access permission for workspace:
|
||
$this->publishAccess = $BE_USER->workspacePublishAccess($BE_USER->workspace);
|
||
... | ... | |
);
|
||
// Add hidden fields and create tabs:
|
||
$content = $this->doc->getDynTabMenu($menuItems,'user_ws');
|
||
$content = $this->doc->getDynTabMenu($menuItems, 'user_ws');
|
||
$this->content.=$this->doc->section('',$content,0,1);
|
||
// Setting up the buttons and markers for docheader
|
typo3/sysext/setup/mod/index.php (Arbeitskopie) | ||
---|---|---|
$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(
|
||
... | ... | |
// render the menu items
|
||
$menuItems = $this->renderUserSetup();
|
||
$this->content .= $this->doc->spacer(20) . $this->doc->getDynTabMenu($menuItems, 'user-setup', false, false, 100, 1, false, 1, $this->dividers2tabs);
|
||
$this->content .= $this->doc->spacer(20) . $this->doc->getDynTabMenu($menuItems, 'user-setup', FALSE, FALSE, 0, 1, FALSE, 1, $this->dividers2tabs);
|
||
// Submit and reset buttons
|
typo3/sysext/impexp/app/index.php (Arbeitskopie) | ||
---|---|---|
}
|
||
');
|
||
// Set up JS for dynamic tab menu
|
||
$this->doc->JScode .= $this->doc->getDynTabMenuJScode();
|
||
// Setting up the context sensitive menu:
|
||
$this->doc->getContextMenuCode();
|
||