Visible = true; $this->Enabled = true; } function Show() { $Output = ''; //$Output .= '#'.$this->Id; return($Output); } function Prepare() { } } class Layout extends Element { var $Items; function Show() { if($this->Visible) { $Output = parent::Show(); foreach($this->Items as $Item) $Output .= $Item->Show(); return($Output); } } function Prepare() { foreach($this->Items as $Item) $Item->Prepare(); } } class Button extends Element { var $Caption; function Show() { if($this->Visible) { return(parent::Show().''); } } } class Edit extends Element { var $Text; function Show() { return(parent::Show().''); } function Prepare() { $this->Text = ReadSessionVar($this->Id.'_Text'); } } class PageSelect extends Element { var $Count; var $Position; var $PageSize; function __construct() { parent::__construct(); $this->PageSize = 10; $this->Position = 0; $this->Count = 0; } function Show() { if(array_key_exists($this->Id.'_Page', $_GET)) $this->Position = $_GET[$this->Id.'_Page']; if($this->Position >= $this->Count) $this->Position = $this->Count / $this->PageSize - 1; $Output = ''; for($I = 0; $I < $this->Count / $this->PageSize; $I++) { $Text = ''.$I.' '; if($I == $this->Position) $Text = ''.$Text.''; $Output .= $Text; } $Output .= '
'; return($Output); } function Prepare() { $this->Position = ReadSessionVar($this->Id.'_Page'); } } class ListViewColumn extends Element { var $Name; function Show() { return($this->Name); } } class ListView extends Element { var $Columns; var $Rows; var $OnColumnClick; var $OnColumnDraw; function __construct() { parent::__construct(); $this->Rows = array(); $this->Columns = array(); } function Show() { $Output = ''; } if($this->OnColumnClick != '') $Output = ''.$Output.''; return($Output); } function Show() { $this->PageSelect->Count = count($this->Rows); $this->OnColumnClick = array($this, 'ColumnClick'); $this->OnColumnDraw = array($this, 'ColumnDraw'); $Output = $this->PageSelect->Show(); $Output .= parent::Show(); $Output .= $this->PageSelect->Show(); return($Output); } function Prepare() { $this->PageSelect->Id = $this->Id.'PageSelect'; $this->PageSelect->Prepare(); $this->SortColumn = ReadSessionVar($this->Id.'_SortColumn'); $this->SortOrder = ReadSessionVar($this->Id.'_SortOrder'); } } class TableLayout extends Element { var $Rows; var $Span; function Show() { $Output .= '
'; foreach($this->Rows as $RowNum => $Row) { $Output .= ''; foreach($Row as $ColNum => $Value) { if($this->Span[$RowNum][$ColNum] != 1) $Span = ' colspan="'.$this->Span[$RowNum][$ColNum].'"'; else $Span = ''; $Output .= ''.$Value->Show().''; } $Output .= ''; } $Output .= '
'; return($Output); } function Prepare() { foreach($this->Rows as $RowNum => $Row) { foreach($Row as $ColNum => $Value) { $Value->Prepare(); } } } } class Label extends Element { var $Caption; var $OnExecute; function Show() { $Output = $this->Caption; if(method_exists($this->OnExecute[0], $this->OnExecute[1])) { $Link = 'O='.$this->Id.'&M=Execute'; $Output = ''.$Output.''; }; return($Output); } function Prepare() { $Object = ReadSessionVar('O', false); $Method = ReadSessionVar('M', false); if(($Object == $this->Id) and ($Method == 'Execute')) call_user_func($this->OnExecute, $this); } } class Page2 { var $Items; function Show() { $Output = ''; foreach($this->Items as $Item) $Output .= $Item->Show(); $Output .= ''; return($Output); } function Prepare() { foreach($this->Items as $Item) $Item->Prepare(); } }