SetOddRowClass('odd_row'); $this->SetEvenRowClass('even_row'); $this->SetCellSpacing(1); $this->SetCellPadding(3); $this->SetHeader(); $this->SortBy(); } function SetHeader($value=NULL,$class='header') { parent::SetHeader($value,$class); } function SetFooter($value=NULL,$class='footer') { parent::SetFooter($value,$class); } function SortBy($value = NULL) { if(!is_numeric($value) && !is_null($value)) { return $this->error("Incorrect value for SortBy [$value]"); } $this->sortby = $value; } function ShowHeader() { if(isset($this->header)) { // create a copy of real header $header = $this->header; if(!is_null($this->sortby)) { $i = 1; foreach($header->items as $id => $col) { $sort = new CSpan(); $down = "_off"; $up = "_off"; if(($i-$this->sortby) == 0) $down = ""; if(($i+$this->sortby) == 0) $up = ""; $sort->AddItem(array( new CImg("images/general/sortup$up.gif"), new CImg("images/general/sortdown$down.gif"), SPACE)); $sort->AddOption("style","float:left"); $header->items[$id]->AddItem($sort); $i++; } } $header->Show(); } } } ?>