. */ /** * Object to display data vertical (like a list pager, but vertical instead of horizontal) */ require_once(ROOTPATH."include/list/ListPager.php"); class VerticalList extends ListPager { /** * Constructor * * @param string name of the shown data (free string, must be unique) * @param string extraParms parameters to be added to links in http encoding * @throws InvalidArgumentException in case arguments are invalid */ public function __construct($name, $extraParms="") { parent::__construct($name, $extraParms); } /** * Display the list * * @param array data to be shown (2-dimensional) */ public function display($data) { if( !isset($data) || !is_array($data) ) { throw new InvalidArgumentException(_("No data array given")); } $this->createColumnsIfNotDefined($data); // Build table $res = "

"; $res .= $this->getTableVertical($data); $res .= "
"; return $res; } protected function getTableVertical($data) { $res = ""; $columnKeys = array_keys($data); $r = 0; foreach($this->getColumns() as $columnObject) { $r++; $res .= ""; $res .= ""; $res .= $columnObject->getHeader(); $res .= ""; $class = $columnObject->getClass(); for( $c=0; $c".$columnObject->getCellValue($c, $data[ $columnKeys[$c] ]).""; } $res .= ""; } return $res; } } ?>