Feature #9647
Add Category Selection in mode 2 (List) and 4 (Next Events)
| Status: | New | Start date: | 2010-09-08 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - | |||
| Votes: | 0 |
Description
Hello, i have adapt the extension to add the possibility to use category selection in List or Next Events mode.
It would be probably useful to be activated or not by Typoscript configuration.
These are the changes in file class.tx_newscalendar_pi1.php :
function makelistNormal($res)
$items=array();
// Make list table rows
while($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
// Modif PM - 08/07/2010 - add category selection
if ( $this->categorySelection && $this->useSubCategories ) {
$this->categorySelection .= ',' . tx_ttnews_div::getSubCategories( $this-
categorySelection );
}
/** START: News category in list if applicable */
if ( $this->categorySelection ) {
$exists = false;
$categoryArray = explode( ",", $this->categorySelection );
foreach ( $categoryArray as $selectedCatId ) {
$exists = array_key_exists( $selectedCatId, tx_ttnews::getCategories( $this->getFieldContent('uid') ) );
if ( $exists ) break;
}
if ( ! $exists ) continue;
}
// FIN Modif PM - 08/07/2010
$items[]=$this->makeListItemNormal();
}
$out = '<div'.$this->pi_classParam('listrow').'>
'.implode(chr(10),$items).'
</div>';
return $out;
}
I've hope it could be useful.
Best regards