version 1.214, 2011/01/09 18:02:40 |
version 1.215, 2011/01/09 18:42:41 |
|
|
* http://platon.sk/projects/phpMyEdit/ |
* http://platon.sk/projects/phpMyEdit/ |
*/ |
*/ |
|
|
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.213 2010-09-20 01:08:46 nepto Exp $ */ |
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.214 2011-01-09 18:02:40 nepto Exp $ */ |
|
|
/* This is a generic table editing program. The table and fields to be |
/* This is a generic table editing program. The table and fields to be |
edited are defined in the calling program. |
edited are defined in the calling program. |
|
|
* functions for indicating whether operations are enabled |
* functions for indicating whether operations are enabled |
*/ |
*/ |
|
|
|
function listall() { return $this->inc <= 0; } |
function add_enabled() { return stristr($this->options, 'A'); } |
function add_enabled() { return stristr($this->options, 'A'); } |
function change_enabled() { return stristr($this->options, 'C'); } |
function change_enabled() { return stristr($this->options, 'C'); } |
function delete_enabled() { return stristr($this->options, 'D'); } |
function delete_enabled() { return stristr($this->options, 'D'); } |
|
|
$qparts['orderby'] = join(',', $sort_fields); |
$qparts['orderby'] = join(',', $sort_fields); |
} |
} |
} |
} |
$qparts['limit'] = $listall ? '' : $this->sql_limit($this->fm,$this->inc); |
$qparts['limit'] = $this->listall() ? '' : $this->sql_limit($this->fm,$this->inc); |
$this->sort_fields_w = $sort_fields_w; // due to display sorting sequence |
$this->sort_fields_w = $sort_fields_w; // due to display sorting sequence |
return $qparts; |
return $qparts; |
} /* }}} */ |
} /* }}} */ |
Line 1894 function '.$this->js['prefix'].'filter_h |
|
Line 1895 function '.$this->js['prefix'].'filter_h |
|
/* |
/* |
* Display buttons at top and bottom of page |
* Display buttons at top and bottom of page |
*/ |
*/ |
function display_list_table_buttons($position, $listall = false) /* {{{ */ |
function display_list_table_buttons($position) /* {{{ */ |
{ |
{ |
if (($but_str = $this->display_buttons($position)) === null) |
if (($but_str = $this->display_buttons($position)) === null) |
return; |
return; |
Line 1910 function '.$this->js['prefix'].'filter_h |
|
Line 1911 function '.$this->js['prefix'].'filter_h |
|
if($this->display['num_pages'] || $this->display['num_records']) |
if($this->display['num_pages'] || $this->display['num_records']) |
echo '<td class="',$this->getCSSclass('stats', $position),'">',"\n"; |
echo '<td class="',$this->getCSSclass('stats', $position),'">',"\n"; |
if($this->display['num_pages']) { |
if($this->display['num_pages']) { |
if ($listall) { |
if ($this->listall()) { |
echo $this->labels['Page'],': 1 ',$this->labels['of'],' 1'; |
echo $this->labels['Page'],': 1 ',$this->labels['of'],' 1'; |
} else { |
} else { |
$current_page = intval($this->fm / $this->inc) + 1; |
$current_page = intval($this->fm / $this->inc) + 1; |
Line 2003 function '.$this->js['prefix'].'filter_h |
|
Line 2004 function '.$this->js['prefix'].'filter_h |
|
return $this->htmlSubmit($name.$this->page_types[$this->page_type], $value, |
return $this->htmlSubmit($name.$this->page_types[$this->page_type], $value, |
$this->getCSSclass($name, $position), $validation); |
$this->getCSSclass($name, $position), $validation); |
} |
} |
$listall = $this->inc <= 0; |
if ($this->listall()) { |
if ($listall) { |
|
$disabledprev = true; |
$disabledprev = true; |
$disablednext = true; |
$disablednext = true; |
$total_pages = 1; |
$total_pages = 1; |
Line 2031 function '.$this->js['prefix'].'filter_h |
|
Line 2031 function '.$this->js['prefix'].'filter_h |
|
return $ret; |
return $ret; |
} |
} |
if ($name == 'goto_combo') { |
if ($name == 'goto_combo') { |
$disabledgoto = !($listall || ($disablednext && $disabledprev)) ? '' : ' disabled'; |
$disabledgoto = !($this->listall() || ($disablednext && $disabledprev)) ? '' : ' disabled'; |
if ($disabledgoto != '' && $disabled < 0) return; |
if ($disabledgoto != '' && $disabled < 0) return; |
$kv_array = array(); |
$kv_array = array(); |
for ($i = 0; $i < $total_pages; $i++) { |
for ($i = 0; $i < $total_pages; $i++) { |
Line 2044 function '.$this->js['prefix'].'filter_h |
|
Line 2044 function '.$this->js['prefix'].'filter_h |
|
} |
} |
if ($name == 'goto') { |
if ($name == 'goto') { |
return $this->htmlSubmit('navop', 'Go to', $this->getCSSclass('goto', $position), |
return $this->htmlSubmit('navop', 'Go to', $this->getCSSclass('goto', $position), |
false, ($listall || ($disablednext && $disabledprev)) ? $disabled : 0); |
false, ($this->listall() || ($disablednext && $disabledprev)) ? $disabled : 0); |
} |
} |
if (in_array($name, array('first','prev','next','last','<<','<','>','>>'))) { |
if (in_array($name, array('first','prev','next','last','<<','<','>','>>'))) { |
$disabled_var = 'disabled'.$name; |
$disabled_var = 'disabled'.$name; |
Line 2250 function '.$this->js['prefix'].'filter_h |
|
Line 2250 function '.$this->js['prefix'].'filter_h |
|
*/ |
*/ |
$select_recs = $this->key != '' && |
$select_recs = $this->key != '' && |
($this->change_enabled() || $this->delete_enabled() || $this->view_enabled()); |
($this->change_enabled() || $this->delete_enabled() || $this->view_enabled()); |
// Are we doing a listall? |
|
$listall = $this->inc <= 0; |
|
/* |
/* |
* Display the SQL table in an HTML table |
* Display the SQL table in an HTML table |
*/ |
*/ |
Line 2259 function '.$this->js['prefix'].'filter_h |
|
Line 2257 function '.$this->js['prefix'].'filter_h |
|
echo $this->get_origvars_html($this->get_sfn_cgi_vars()); |
echo $this->get_origvars_html($this->get_sfn_cgi_vars()); |
echo $this->htmlHiddenSys('fl', $this->fl); |
echo $this->htmlHiddenSys('fl', $this->fl); |
// Display buttons at top and/or bottom of page. |
// Display buttons at top and/or bottom of page. |
$this->display_list_table_buttons('up', $listall); |
$this->display_list_table_buttons('up'); |
if ($this->cgi['persist'] != '') { |
if ($this->cgi['persist'] != '') { |
echo $this->get_origvars_html($this->cgi['persist']); |
echo $this->get_origvars_html($this->cgi['persist']); |
} |
} |
Line 2529 function '.$this->js['prefix'].'filter_h |
|
Line 2527 function '.$this->js['prefix'].'filter_h |
|
echo '</tr>',"\n"; |
echo '</tr>',"\n"; |
} |
} |
echo '</table>',"\n"; // end of table rows listing |
echo '</table>',"\n"; // end of table rows listing |
$this->display_list_table_buttons('down', $listall); |
$this->display_list_table_buttons('down'); |
$this->form_end(); |
$this->form_end(); |
} /* }}} */ |
} /* }}} */ |
|
|