Commit 90a04d1f authored by Kasper Skårhøj's avatar Kasper Skårhøj
Browse files

* Added a checkbox to the page header in the "cms" extension called "Hide in menu". With this checkbox the page is excluded from menus on the totally same terms as doktype=5 ("Not in menu") does. The implementation is believed to be complete (although there might be some places overlooked). The checkbox renders the doktype 5 "Not in menu" obsolete; the idea is that the checkbox should be used in the future. However it is not that easy to just skip the doktype=5 option. For now a configuration flag has been set by which it can be disabled (see configuration of the "cms" extension). Finally - if anyone read this far - I prophecise, that within two weeks from this moment someone will approach me and want to have a visual response to the "Hide in menu" checkbox in the icon; currently the page icon does NOT change it looks (and it would be very doubtful if we could justify making it change...).


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@208 709f56b5-9817-0410-a4d7-c38de5d9e867
parent 313e59af
2004-04-19 Kasper Skårhøj,,, <kasper@typo3.com>
* Added a checkbox to the page header in the "cms" extension called "Hide in menu". With this checkbox the page is excluded from menus on the totally same terms as doktype=5 ("Not in menu") does. The implementation is believed to be complete (although there might be some places overlooked). The checkbox renders the doktype 5 "Not in menu" obsolete; the idea is that the checkbox should be used in the future. Finally - if anyone read this far - I prophecise, that within two weeks from this moment someone will approach me and want to have a visual response to the "Hide in menu" checkbox in the icon; currently the page icon does NOT change it looks (and it would be very doubtful if we could justify making it change...).
2004-04-19 Kasper Skårhøj,,, <kasper@typo3.com>
* Added new FORM cObject type, "label", which inserts a label instead of a field. Also fixed ordering problem when the "dataArray" attribute of FORM is used (now renders the form in the numerical order of the elements instead of order of appearance).
2004-04-19 Kasper Skårhøj,,, <kasper@typo3.com>
* Fixed incompatibility between Mount Points and property "overrideId" in menus.
......
......@@ -1473,9 +1473,10 @@ class t3lib_BEfunc {
$parts[] = $LANG->sL($TCA['pages']['columns']['mount_pid_ol']['label']);
}
}
if ($row['hidden']) $parts[]=$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.hidden');
if ($row['starttime']) $parts[]=$LANG->sL($TCA['pages']['columns']['starttime']['label']).' '.t3lib_BEfunc::dateTimeAge($row['starttime'],-1,'date');
if ($row['endtime']) $parts[]=$LANG->sL($TCA['pages']['columns']['endtime']['label']).' '.t3lib_BEfunc::dateTimeAge($row['endtime'],-1,'date');
if ($row['nav_hide']) $parts[] = ereg_replace(':$','',$LANG->sL($TCA['pages']['columns']['nav_hide']['label']));
if ($row['hidden']) $parts[] = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.hidden');
if ($row['starttime']) $parts[] = $LANG->sL($TCA['pages']['columns']['starttime']['label']).' '.t3lib_BEfunc::dateTimeAge($row['starttime'],-1,'date');
if ($row['endtime']) $parts[] = $LANG->sL($TCA['pages']['columns']['endtime']['label']).' '.t3lib_BEfunc::dateTimeAge($row['endtime'],-1,'date');
if ($row['fe_group']) {
if ($row['fe_group']<0) {
$label = $LANG->sL(t3lib_BEfunc::getLabelFromItemlist('pages','fe_group',$row['fe_group']));
......
......@@ -1214,18 +1214,22 @@ class t3lib_TStemplate {
* Call it like t3lib_TStemplate::sortedKeyList()
*
* @param array TypoScript array with numerical array in
* @param boolean If set, then a value is not required - the properties alone will be enough.
* @return array An array with all integer properties listed in numeric order.
* @see tslib_cObj::cObjGet(), tslib_gifBuilder, tslib_imgmenu::makeImageMap()
*/
function sortedKeyList($setupArr) {
$keyArr=Array();
function sortedKeyList($setupArr, $acceptOnlyProperties=FALSE) {
$keyArr = Array();
reset($setupArr);
while(list($key,)=each($setupArr)) {
$ikey=intval($key);
if (!strcmp($ikey,$key)) {
$keyArr[]=$ikey;
$ikey = intval($key);
if (!strcmp($ikey,$key) || $acceptOnlyProperties) {
$keyArr[] = $ikey;
}
}
$keyArr = array_unique($keyArr);
sort($keyArr);
return $keyArr;
}
......
......@@ -172,6 +172,7 @@ class SC_alt_db_navframe {
$this->pagetree->addField('shortcut_mode');
$this->pagetree->addField('mount_pid');
$this->pagetree->addField('mount_pid_ol');
$this->pagetree->addField('nav_hide');
$this->pagetree->addField('url');
// Setting highlight mode:
......
......@@ -172,6 +172,13 @@ if (TYPO3_MODE=='BE') {
'eval' => 'trim'
)
),
'nav_hide' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:cms/locallang_tca.php:pages.nav_hide',
'config' => Array (
'type' => 'check'
)
),
'subtitle' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:cms/locallang_tca.php:pages.subtitle',
......@@ -435,15 +442,15 @@ if (TYPO3_MODE=='BE') {
// Totally overriding all type-settings:
$TCA['pages']['types'] = Array (
'1' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, TSconfig;;6;nowrap;5-5-5, storage_pid;;7'),
'2' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_title, --div--, abstract;;5;;3-3-3, keywords, description, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, module, content_from_pid'),
'3' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;3;;2-2-2, url;;4;;3-3-3, TSconfig;;6;nowrap;5-5-5, storage_pid;;7'),
'4' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;3;;2-2-2, shortcut;;9;;3-3-3, TSconfig;;6;nowrap;5-5-5, storage_pid;;7'),
'5' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_title, --div--, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, module, content_from_pid'),
'7' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_title, --div--, mount_pid;;8;;3-3-3, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, module, content_from_pid'),
'1' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, TSconfig;;6;nowrap;5-5-5, storage_pid;;7'),
'2' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, nav_title, --div--, abstract;;5;;3-3-3, keywords, description, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, module, content_from_pid'),
'3' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;3;;2-2-2, nav_hide, url;;;;3-3-3, urltype, TSconfig;;6;nowrap;5-5-5, storage_pid;;7'),
'4' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;3;;2-2-2, nav_hide, shortcut;;;;3-3-3, shortcut_mode, TSconfig;;6;nowrap;5-5-5, storage_pid;;7'),
'5' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, nav_title, --div--, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, module, content_from_pid'),
'7' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, nav_title, --div--, mount_pid;;;;3-3-3, mount_pid_ol, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, module, content_from_pid'),
'199' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;;;2-2-2, TSconfig;;6;nowrap;5-5-5, storage_pid;;7'),
'254' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;LLL:EXT:lang/locallang_general.php:LGL.title;;;2-2-2, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, module'),
'255' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;;;2-2-2, TSconfig;;6;nowrap;5-5-5, storage_pid;;7')
'255' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;;;2-2-2')
);
// Merging palette settings:
// t3lib_div::array_merge() MUST be used - otherwise the keys will be re-numbered!
......@@ -451,10 +458,7 @@ if (TYPO3_MODE=='BE') {
'1' => Array('showitem' => 'starttime,endtime,fe_group,extendToSubpages'),
'2' => Array('showitem' => 'layout, lastUpdated, newUntil, no_search'),
'3' => Array('showitem' => 'alias, target, no_cache, cache_timeout'),
'4' => Array('showitem' => 'urltype'),
'5' => Array('showitem' => 'author,author_email'),
'8' => Array('showitem' => 'mount_pid_ol'),
'9' => Array('showitem' => 'shortcut_mode'),
));
......
......@@ -378,6 +378,7 @@ CREATE TABLE pages (
author tinytext NOT NULL,
author_email varchar(80) DEFAULT '' NOT NULL,
nav_title tinytext NOT NULL,
nav_hide tinyint(4) DEFAULT '0' NOT NULL,
content_from_pid int(10) unsigned DEFAULT '0' NOT NULL,
mount_pid int(10) unsigned DEFAULT '0' NOT NULL,
mount_pid_ol tinyint(4) DEFAULT '0' NOT NULL,
......
......@@ -16,6 +16,7 @@ $LOCAL_LANG = Array (
'pages.layout.I.3' => 'Layout 3',
'pages.extendToSubpages' => 'Include subpages:',
'pages.nav_title' => 'Navigation title:',
'pages.nav_hide' => 'Hide in menu:',
'pages.subtitle' => 'Subtitle:',
'pages.target' => 'Target:',
'pages.alias' => 'Alias:',
......
......@@ -1482,9 +1482,10 @@ class tslib_cObj {
}
// Adding the new dataArray config form:
if (is_array($conf['dataArray.'])) { // dataArray is supplied
reset($conf['dataArray.']);
while(list($dAKey,$dAA)=each($conf['dataArray.'])) {
if (is_array($dAA) && !strcmp(intval($dAKey).'.',$dAKey)) {
$sKeyArray = t3lib_TStemplate::sortedKeyList($conf['dataArray.'], TRUE);
foreach($sKeyArray as $theKey) {
$dAA = $conf['dataArray.'][$theKey.'.'];
if (is_array($dAA)) {
$temp=array();
list($temp[0])= explode('|',$dAA['label.'] ? $this->stdWrap($dAA['label'],$dAA['label.']) : $dAA['label']);
list($temp[1])= explode('|',$dAA['type']);
......@@ -1710,9 +1711,12 @@ class tslib_cObj {
$confData['fieldname'], t3lib_div::deHSCentities(htmlspecialchars($value)));
}
break;
case 'label':
$fieldCode = nl2br(htmlspecialchars(trim($parts[2])));
break;
default:
$confData['type']='comment';
$fieldCode=trim($parts[2]).'&nbsp;';
$confData['type'] = 'comment';
$fieldCode = trim($parts[2]).'&nbsp;';
break;
}
if ($fieldCode) {
......@@ -1771,6 +1775,9 @@ class tslib_cObj {
if ($confData['type']=='radio' && $conf['RADIO.']['layout']) {
$result = $conf['RADIO.']['layout'];
}
if ($confData['type']=='label' && $conf['LABEL.']['layout']) {
$result = $conf['LABEL.']['layout'];
}
$result = str_replace('###FIELD###',$fieldCode,$result);
$result = str_replace('###LABEL###',$labelCode,$result);
$result = str_replace('###COMMENT###',$commentCode,$result); //RTF
......
......@@ -433,7 +433,7 @@ class tslib_menu {
break;
}
// Get
$extraWhere = ' AND pages.doktype NOT IN (5,6)';
$extraWhere = ' AND pages.doktype NOT IN (5,6) AND pages.nav_hide=0';
if ($this->conf['special.']['excludeNoSearchPages']) {
$extraWhere.= ' AND pages.no_search=0';
......@@ -488,7 +488,7 @@ class tslib_menu {
$depth=20;
}
$limit = t3lib_div::intInRange($this->conf['special.']['limit'],0,100); // max number of items
$extraWhere = ' AND pages.uid!='.$value.' AND pages.doktype NOT IN (5,6)';
$extraWhere = ' AND pages.uid!='.$value.' AND pages.doktype NOT IN (5,6) AND pages.nav_hide=0';
if ($this->conf['special.']['excludeNoSearchPages']) {
$extraWhere.= ' AND pages.no_search=0';
}
......@@ -716,7 +716,7 @@ class tslib_menu {
$uid = $data['uid'];
$spacer = (t3lib_div::inList($this->spacerIDList,$data['doktype'])?1:0); // if item is a spacer, $spacer is set
if ($this->mconf['SPC'] || !$spacer) { // If the spacer-function is not enabled, spacers will not enter the $menuArr
if (!t3lib_div::inList('5,6',$data['doktype']) && !t3lib_div::inArray($banUidArray,$uid)) { // Page may not be 'not_in_menu' or 'Backend User Section' + not in banned uid's
if (!t3lib_div::inList('5,6',$data['doktype']) && !$data['nav_hide'] && !t3lib_div::inArray($banUidArray,$uid)) { // Page may not be 'not_in_menu' or 'Backend User Section' + not in banned uid's
$c_b++;
if ($begin<=$c_b) { // If the beginning item has been reached.
$this->menuArr[$c] = $data;
......@@ -1132,7 +1132,7 @@ class tslib_menu {
$recs = $this->sys_page->getMenu($uid,'uid,pid,doktype,mount_pid,mount_pid_ol');
foreach($recs as $theRec) {
if (!t3lib_div::inList('5,6',$theRec['doktype'])) { // If a menu item seems to be another type than 'Not in menu', then return true (there were items!)
if (!t3lib_div::inList('5,6',$theRec['doktype']) && !$theRec['nav_hide']) { // If a menu item seems to be another type than 'Not in menu', then return true (there were items!)
return TRUE;
}
}
......@@ -2448,7 +2448,7 @@ class tslib_jsmenu extends tslib_menu {
foreach($menuItems as $uid => $data) {
$spacer = (t3lib_div::inList($this->spacerIDList,$data['doktype'])?1:0); // if item is a spacer, $spacer is set
if ($this->mconf['SPC'] || !$spacer) { // If the spacer-function is not enabled, spacers will not enter the $menuArr
if (!t3lib_div::inList('5,6',$data['doktype']) && !t3lib_div::inArray($banUidArray,$uid)) { // Page may not be 'not_in_menu' or 'Backend User Section' + not in banned uid's
if (!t3lib_div::inList('5,6',$data['doktype']) && !$data['nav_hide'] && !t3lib_div::inArray($banUidArray,$uid)) { // Page may not be 'not_in_menu' or 'Backend User Section' + not in banned uid's
if ($count<$levels) {
$addLines = $this->generate_level($levels,$count+1,$data['uid'],'',$MP_array);
} else {
......
<?php
/***************************************************************
* Copyright notice
*
*
* (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
* 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
* 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
......@@ -37,21 +37,21 @@
*
*
*
* 129: class user_wapversion
* 141: function main_wapversion($content,$conf)
* 200: function contentAbstract()
* 217: function contentAll($chunkLgd=850)
* 277: function cHeader($str)
* 291: function cBodytext($str,$start=0,$max=0)
* 303: function nl2br($str)
* 314: function getContentResult($table)
* 329: function bold($str)
* 339: function paragraph($str)
* 349: function line($str)
* 360: function navLink($str,$pointer)
* 370: function menuCurrentLevel($indent)
* 405: function link($str,$id,$deck='')
* 421: function cleanMenuArray($menu)
* 129: class user_wapversion
* 141: function main_wapversion($content,$conf)
* 200: function contentAbstract()
* 217: function contentAll($chunkLgd=850)
* 277: function cHeader($str)
* 291: function cBodytext($str,$start=0,$max=0)
* 303: function nl2br($str)
* 314: function getContentResult($table)
* 329: function bold($str)
* 339: function paragraph($str)
* 349: function line($str)
* 360: function navLink($str,$pointer)
* 370: function menuCurrentLevel($indent)
* 405: function link($str,$id,$deck='')
* 421: function cleanMenuArray($menu)
*
* TOTAL FUNCTIONS: 14
* (This index is automatically created/updated by the extension "extdeveval")
......@@ -151,15 +151,15 @@ class user_wapversion {
// Creating back button:
$xmlObj->WAPback();
$pageRec = $GLOBALS['TSFE']->page;
if ($GLOBALS['TSFE']->idParts[1]) {
// Creating content card:
$xmlObj->newLevel('card',1,array(
'id' => 'content',
'id' => 'content',
'title' => ($conf['preTitle']?$conf['preTitle'].': ':'').$pageRec['title']
));
$cParts = $this->contentAll();
$pointer = t3lib_div::intInRange($GLOBALS['TSFE']->idParts[1],1,10000);
......@@ -168,16 +168,16 @@ class user_wapversion {
$msg.=$this->navLink(htmlspecialchars($conf['navLabels.']['up']),0).' ';
if ($pointer<count($cParts)) {$msg.=$this->navLink(htmlspecialchars($conf['navLabels.']['next']),$pointer+1).' ';}
$msg.= '['.$pointer.'/'.count($cParts).']<br/>';
$xmlObj->lines[] = $this->paragraph($msg);
$xmlObj->lines[] = $this->paragraph($cParts[$pointer-1]);
$xmlObj->lines[] = $this->paragraph('<br/>'.$msg);
$xmlObj->newLevel('card',0);
} else {
// Creating menu card:
$xmlObj->newLevel('card',1,array(
'id' => 'menu',
'id' => 'menu',
'title' => ($conf['preTitle']?$conf['preTitle'].': ':'').$pageRec['title']
));
$xmlObj->lines[] = $this->contentAbstract();
......@@ -244,8 +244,8 @@ class user_wapversion {
default:
$bodyText = '[Un-rendered element, '.$row['CType'].']';
break;
}
}
// Bodytext:
$get = $this->cBodytext($bodyText).'<br/>';
$diff = $chunkLgd - strlen($out[$idx]);
......@@ -254,7 +254,7 @@ class user_wapversion {
$out[$idx].=$get;
} else {
$out[$idx].=$this->cBodytext($bodyText,0,$diff+$overlap).'<br/>';
$safe=0;
do {
$idx++;
......@@ -327,7 +327,7 @@ class user_wapversion {
* @return string Processed output.
*/
function bold($str) {
return strtoupper($str);
return strtoupper($str);
}
/**
......@@ -422,11 +422,11 @@ class user_wapversion {
reset($menu);
$newMenu=array();
while(list(,$data)=each($menu)) {
if ($data['doktype']!=5) {
if ($data['doktype']!=5 && !$data['nav_hide']) {
$newMenu[]=$data;
}
}
return $newMenu;
return $newMenu;
}
}
......@@ -441,7 +441,7 @@ switch($id) {
<timer value="35"/>
<p>
<img src="/images/logo.wbmp" alt="WAPPORTAL"/>
asf asdf asdf
asf asdf asdf
</p>
</card>
<card id="Login" title="wapportal.dk" newcontext="true">
......@@ -465,7 +465,7 @@ switch($id) {
Dette er noget
<img src="/images/logo.wbmp" alt="WAPPORTAL"/>
tekst.</p>
</card>
</wml>
break;
......
......@@ -43,6 +43,7 @@ $LOCAL_LANG = Array (
'forms_type_hidden' => 'Hidden value',
'forms_type_submit' => 'Submit Button',
'forms_type_property' => 'Property',
'forms_type_label' => 'Label',
'forms_required' => 'Required',
'forms_fieldName' => 'Field',
'forms_cols' => 'Columns',
......
......@@ -424,7 +424,7 @@ class SC_wizard_forms {
// Field type selector:
$opt=array();
$opt[]='<option value=""></option>';
$types = explode(',','input,textarea,select,check,radio,password,file,hidden,submit,property');
$types = explode(',','input,textarea,select,check,radio,password,file,hidden,submit,property,label');
foreach($types as $t) {
$opt[]='
<option value="'.$t.'"'.($confData['type']==$t?' selected="selected"':'').'>'.$LANG->getLL('forms_type_'.$t,1).'</option>';
......@@ -441,7 +441,7 @@ class SC_wizard_forms {
}
// Required checkbox:
if (!t3lib_div::inList('check,hidden,submit',$confData['type'])) {
if (!t3lib_div::inList('check,hidden,submit,label',$confData['type'])) {
$temp_cells[$LANG->getLL('forms_required')]='<input type="checkbox" name="FORMCFG[c]['.(($k+1)*2).'][required]" value="1"'.($confData['required']?' checked="checked"':'').' title="'.$LANG->getLL('forms_required',1).'" />';
}
......@@ -456,7 +456,9 @@ class SC_wizard_forms {
if ($this->special=='formtype_mail' && $confData['type']=='file') {
$confData['fieldname'] = 'attachment'.(++$this->attachmentCounter);
}
$temp_cells[$LANG->getLL('forms_fieldName')]='<input type="text"'.$this->doc->formWidth(10).' name="FORMCFG[c]['.(($k+1)*2).'][fieldname]" value="'.htmlspecialchars($confData['fieldname']).'" title="'.$LANG->getLL('forms_fieldName',1).'" />';
if (!t3lib_div::inList('label',$confData['type'])) {
$temp_cells[$LANG->getLL('forms_fieldName')]='<input type="text"'.$this->doc->formWidth(10).' name="FORMCFG[c]['.(($k+1)*2).'][fieldname]" value="'.htmlspecialchars($confData['fieldname']).'" title="'.$LANG->getLL('forms_fieldName',1).'" />';
}
// Field configuration depending on the fields type:
switch((string)$confData['type']) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment