Project

General

Profile

Feature #16680 ยป bug_4452.diff

Administrator Admin, 2006-11-04 21:22

View differences:

class.tslib_pibase.php 2006-11-02 21:30:41.000000000 +0100
* SECTION: Functions for listing, browsing, searching etc.
* 456: function pi_list_browseresults($showResultCount=1,$tableParams='',$wrapArr=array(), $pointerName = 'pointer', $hscText = TRUE)
* 618: function pi_list_searchBox($tableParams='')
* 649: function pi_list_modeSelector($items=array(),$tableParams='')
* 649: function pi_list_modeselector($items=array(),$tableparams='')
* 687: function pi_list_makelist($res,$tableParams='')
* 722: function pi_list_row($c)
* 734: function pi_list_header()
......
*
* @param array Key/Value pairs for the menu; keys are the piVars[mode] values and the "values" are the labels for them.
* @param string Attributes for the table tag which is wrapped around the table cells containing the menu
* @param int Number of rows the menu should be rendered
* @return string Output HTML, wrapped in <div>-tags with a class attribute
*/
function pi_list_modeSelector($items=array(),$tableParams='') {
function pi_list_modeSelector($items=array(),$tableParams='',$rows=1) {
$count = count($items);
$perRow = (int)($count / $rows);
$cells=array();
reset($items);
$i=0; $n=0;
while(list($k,$v)=each($items)) {
$cells[]='
$cells[$n][]='
<td'.($this->piVars['mode']==$k?$this->pi_classParam('modeSelector-SCell'):'').'><p>'.
$this->pi_linkTP_keepPIvars(htmlspecialchars($v),array('mode'=>$k),$this->pi_isOnlyFields($this->pi_isOnlyFields)).
'</p></td>';
$i++;
if($i == $perRow) {
$n++; $i=0;
}
}
$sTables = '
<!--
Mode selector (menu for list):
-->
<div'.$this->pi_classParam('modeSelector').'>
<'.trim('table '.$tableParams).'>';
foreach($cells as $line) {
$sTables .= '<tr>
'.implode('',$line).'
</tr>';
}
<!--
Mode selector (menu for list):
-->
<div'.$this->pi_classParam('modeSelector').'>
<'.trim('table '.$tableParams).'>
<tr>
'.implode('',$cells).'
</tr>
</table>
$sTables .= '</table>
</div>';
return $sTables;
    (1-1/1)