4 |
## $Id$ |
## $Id$ |
5 |
## ------------------------------------------------------------------------- |
## ------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
|
## Revision 1.14 2004/11/15 16:51:48 jonen |
8 |
|
## + added var 'numrows' to constructor args |
9 |
|
## |
10 |
|
## Revision 1.13 2004/10/07 14:17:50 jonen |
11 |
|
## + pass filter-values to backend now! (page-control!) |
12 |
|
## |
13 |
|
## Revision 1.12 2004/05/06 17:14:35 jonen |
14 |
|
## updated |
15 |
|
## |
16 |
## Revision 1.11 2003/05/10 17:58:45 jonen |
## Revision 1.11 2003/05/10 17:58:45 jonen |
17 |
## + reworked to implement 'create/add new' item |
## + reworked to implement 'create/add new' item |
18 |
## |
## |
106 |
* |
* |
107 |
* |
* |
108 |
*/ |
*/ |
109 |
function GenericGUIDataList($title, $width = "100%", $default_orderby='', $default_reverseorder=FALSE, $options = array()) { |
function GenericGUIDataList($title, $width = "100%", $default_orderby='', $default_reverseorder=FALSE, $num_rows=10, $options = array()) { |
110 |
if ($options) { $this->_options = $options; } |
if ($options) { $this->_options = $options; } |
111 |
|
|
112 |
|
$this->set_numrows($num_rows); |
113 |
|
|
114 |
// call parent constructor |
// call parent constructor |
115 |
$parent = get_parent_class($this); |
$parent = get_parent_class($this); |
116 |
$this->$parent($title, $width = "100%", $default_orderby='', $default_reverseorder=FALSE); |
$this->$parent($title, $width = "100%", $default_orderby='', $default_reverseorder=FALSE); |
117 |
|
|
118 |
} |
} |
119 |
|
|
120 |
|
|
150 |
// V5: |
// V5: |
151 |
//print "options: " . Dumper($this->_options); |
//print "options: " . Dumper($this->_options); |
152 |
|
|
153 |
|
|
154 |
|
//HACK 2004-10-07: page-filter done by backend now, |
155 |
|
// filter-values are passed to backend |
156 |
|
$this->_options['data_locator_meta']['filter']['offset'] = $this->offset(); |
157 |
|
$this->_options['data_locator_meta']['filter']['numrows'] = $this->numrows(); |
158 |
|
$this->_options['data_locator_meta']['filter']['search_field'] = $this->search_field(); |
159 |
|
$this->_options['data_locator_meta']['filter']['search_value'] = $this->search_value(); |
160 |
|
$this->_options['data_locator_meta']['filter']['search_modifier'] = $this->simple_search_modifier_value(); |
161 |
|
|
162 |
|
//$this->_set("offsetVar", 0); |
163 |
|
|
164 |
$initial_locator = php::mkComponent( 'DataSource::Locator', array( adapter_type => 'phpHtmlLib' ) ); |
$initial_locator = php::mkComponent( 'DataSource::Locator', array( adapter_type => 'phpHtmlLib' ) ); |
165 |
//print "1st locator: " . Dumper($initial_locator); |
//print "1st locator: " . Dumper($initial_locator); |
166 |
|
|
184 |
$source = $proxy->get_adapter(); |
$source = $proxy->get_adapter(); |
185 |
|
|
186 |
// V4: |
// V4: |
187 |
//$source = $this->_datasource; |
//$source = $this->_datasource; |
188 |
|
|
189 |
//print "objectlist-source: " . Dumper($source); |
//print "objectlist-source: " . Dumper($source); |
190 |
//exit; |
//exit; |
191 |
|
|
202 |
|
|
203 |
//print Dumper($source); |
//print Dumper($source); |
204 |
$headers = $source->get_header(); |
$headers = $source->get_header(); |
205 |
//print Dumper($headers); |
//print "headers: " . Dumper($headers); |
206 |
|
|
207 |
$this->set_title( $this->get_title() . ' - ' . $source->get_total_rows() . ' Einträge' ); |
$this->set_title( $this->get_title() . ' - ' . $source->get_total_rows() . ' Einträge' ); |
208 |
|
|
209 |
foreach($headers as $val) { |
foreach($headers as $val) { |
210 |
$this->add_header_item($val, "150", $val, SORTABLE, SEARCHABLE); |
$this->add_header_item($val, "150", $val, SORTABLE, SEARCHABLE); |
211 |
} |
} |
212 |
|
|
213 |
|
|
214 |
/* |
/* |
215 |
$this->add_header_item("Uid", "200", "uid", SORTABLE, SEARCHABLE); |
$this->add_header_item("Uid", "200", "uid", SORTABLE, SEARCHABLE); |
233 |
* @return TDtag object |
* @return TDtag object |
234 |
*/ |
*/ |
235 |
function wrap_column_item($obj, $col_name, $row_data) { |
function wrap_column_item($obj, $col_name, $row_data) { |
236 |
|
|
237 |
|
//print "item: " . Dumper($obj) . "<br>"; |
238 |
|
|
239 |
//make sure its set to something. |
//make sure its set to something. |
240 |
if ($obj == '') { |
if ($obj == '') { |
432 |
|
|
433 |
/** |
/** |
434 |
* this is the method that builds |
* this is the method that builds |
435 |
* the contents for the 'create new' actionbar |
* the contents for the buttons of actionbar |
436 |
* td cell. |
* td cell. |
437 |
* |
* |
438 |
* @return ContainerWidget object |
* @return ContainerWidget object |
439 |
*/ |
*/ |
440 |
function actionbar_cell_new() { |
function actionbar_cell_new() { |
441 |
$action_create = $this->_options['actionbar']['create']; |
$action_buttons = $this->_options['actionbar']['buttons']; |
442 |
|
|
443 |
if(is_array($action_create)) { |
if(is_array($action_buttons)) { |
444 |
$action_form = container( |
$action_form = container(); |
445 |
|
foreach($action_buttons as $type) { |
446 |
|
$action_form->add( |
447 |
_HTML_SPACE, |
_HTML_SPACE, |
448 |
form_submit($action_create['name'], $action_create['value']) |
form_submit($type['name'], $type['value']) |
449 |
); |
); |
450 |
|
} |
451 |
return $action_form; |
return $action_form; |
452 |
} else { |
} else { |
453 |
return _HTML_SPACE; |
return _HTML_SPACE; |
499 |
if ( $this->_show_results() ) { |
if ( $this->_show_results() ) { |
500 |
$this->data_prefetch(); |
$this->data_prefetch(); |
501 |
} |
} |
502 |
|
|
503 |
//This function gives the child class |
//This function gives the child class |
504 |
//a chance to build the tables/divs/containers |
//a chance to build the tables/divs/containers |
505 |
//that will be responsible for the look/feel |
//that will be responsible for the look/feel |
570 |
|
|
571 |
function child_add_row_cell($obj, $col_name, $last_in_row_flag, $row_data) { |
function child_add_row_cell($obj, $col_name, $last_in_row_flag, $row_data) { |
572 |
if (!$this->_cur_col_cntr) { |
if (!$this->_cur_col_cntr) { |
573 |
|
//if (!isset($this->_cur_col_cntr)) { |
574 |
$this->_cur_col_cntr = 1; |
$this->_cur_col_cntr = 1; |
575 |
//lets see if we need to add an action column |
//lets see if we need to add an action column |
576 |
//as the first column. |
//as the first column. |