Project

General

Profile

Actions

Bug #15514

closed

Yet another table accessibility improvement

Added by J©rémy Lecour over 18 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
-
Start date:
2006-01-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When youmake a table element, you can ask to have or have-not CSS styles with the table.
You can also ask for a specific css class for you table. The BE tool doesn't tell that if you want a specific class, you have to disable other classes.

I have a patch that could be good to improve this and permit to have the auto-built classes PLUS the specific class

Original code :
$tableTagParams = $this->getTableAttributes($conf,$type);
if (!$noStyles) {
$tableTagParams['class'] = 'contenttable contenttable-'.$type;
} elseif ($tableClass) {
$tableTagParams['class'] = $tableClass;
}

My proposition :
$tableTagParams = $this->getTableAttributes($conf,$type);
if (!$noStyles) {
$tableTagParams['class'] = 'contenttable contenttable-'.$type.' '.$tableClass;
} elseif ($tableClass) {
$tableTagParams['class'] = $tableClass;
}

(issue imported from #M2405)


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #16080: Yet another table accessibility improvementClosed2006-04-24

Actions
Actions #1

Updated by Sebastian Kurfuerst over 18 years ago

fixed in CVS.

Actions #2

Updated by J©rémy Lecour over 18 years ago

I've found something quite similar.

When I make a table, I can specify a border size, cellpadding and cellspacing.
If a value is detected, "css_styled_content" adds it in the <table>-tag.

But the "cms" sysext doesn't allow a 0 value. It doesn't seem to be right because I don't want any of these tag attributes, I don't give any value, but if I want a value set to 0 (because of a HTML rendering quirk), I'm not allowed to.

So I've modified both "cms" and "css_styled_content" to accept a 0 value.

In /typo3/sysext/cms/tbl_tt_content.php, after line 736, I've removed the 0 value of "checkbox".
Here is the result :
'table_border' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:cms/locallang_ttc.php:table_border',
'config' => Array (
'type' => 'input',
'size' => '3',
'max' => '3',
'eval' => 'int',
'checkbox' => '',
'range' => Array (
'upper' => '20',
'lower' => '0'
),
'default' => 0
)
),
'table_cellspacing' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:cms/locallang_ttc.php:table_cellspacing',
'config' => Array (
'type' => 'input',
'size' => '3',
'max' => '3',
'eval' => 'int',
'checkbox' => '',
'range' => Array (
'upper' => '200',
'lower' => '0'
),
'default' => 0
)
),
'table_cellpadding' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:cms/locallang_ttc.php:table_cellpadding',
'config' => Array (
'type' => 'input',
'size' => '3',
'max' => '3',
'eval' => 'int',
'checkbox' => '',
'range' => Array (
'upper' => '200',
'lower' => '0'
),
'default' => 0
)
),

In /typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php, after line 834, I've modified the condition to transform the value in integer (with the "intval" function) and checked it to be >= 0.
Here is the result :
$tableTagParams['border'] = intval($this->cObj->data['table_border']) >= 0 ? intval($this->cObj->data['table_border']) : $tableTagParams_conf['border'];
$tableTagParams['cellspacing'] = intval($this->cObj->data['table_cellspacing']) >= 0 ? intval($this->cObj->data['table_cellspacing']) : $tableTagParams_conf['cellspacing'];
$tableTagParams['cellpadding'] = intval($this->cObj->data['table_cellpadding']) >= 0 ? intval($this->cObj->data['table_cellpadding']) : $tableTagParams_conf['cellpadding'];

I've done sme testing and it's OK for me.
It'd be good to fix it in the CVS for the 4.0rc1

Thank you

Actions #3

Updated by J©rémy Lecour over 18 years ago

Another one ;-)

In /typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php on line 205.

The last cell of the current row is marked with a "td-last" class, but loses it's number.

The original code :
$rowAttribs = ($k>0 && ($rCount-1)==$k) ? ' class="'.$oddEven.' tr-last"' : ' class="'.$oddEven.' tr-'.$k.'"';

The modified one :
$rowAttribs = ($k>0 && ($rCount-1)==$k) ? ' class="'.$oddEven.' tr-last tr-'.$k.'"' : ' class="'.$oddEven.' tr-'.$k.'"';

This way you can reach any TD by it's number in the row with a css class, whether it is the last or any other.

Actions #4

Updated by Sebastian Kurfuerst about 18 years ago

Hi Jérémy,
can you please create a patch of your changes and attach it here? This would be of great help.

Thanks,
Sebastian

PS: Please make sure you use diff -u

Actions #5

Updated by Sebastian Kurfuerst almost 18 years ago

Hi,
does anybody have time for that?
Greets, Sebastian

Actions #6

Updated by Ernesto Baschny almost 18 years ago

Proposed patch is in the bug 3325

Actions #7

Updated by Ernesto Baschny almost 18 years ago

Continue in #3325

Actions

Also available in: Atom PDF