| version 1.106, 2003/12/30 21:22:44 |
version 1.107, 2003/12/30 21:38:27 |
|
|
| * http://platon.sk/projects/phpMyEdit/ |
* http://platon.sk/projects/phpMyEdit/ |
| */ |
*/ |
| |
|
| /* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.105 2003/12/30 20:55:52 nepto Exp $ */ |
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.106 2003/12/30 21:22:44 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. |
|
|
| * Create JavaScripts |
* Create JavaScripts |
| */ |
*/ |
| |
|
| function create_javascripts() /* {{{ */ |
function form_begin() /* {{{ */ |
| { |
{ |
| /* |
/* |
| Need a lot of work in here |
Need a lot of work in here |
|
|
| $fdd['fieldname']['validate']['php_regex']='something'; |
$fdd['fieldname']['validate']['php_regex']='something'; |
| */ |
*/ |
| $page_name = htmlspecialchars($this->page_name); |
$page_name = htmlspecialchars($this->page_name); |
| |
$form_atts = ''; |
| |
|
| if ($this->add_operation() || $this->change_operation() || $this->copy_operation() |
if ($this->add_operation() || $this->change_operation() || $this->copy_operation() |
| || $this->view_operation() || $this->delete_operation()) { |
|| $this->view_operation() || $this->delete_operation()) { |
| Line 823 function phpMyEdit_form_control(theForm) |
|
| Line 824 function phpMyEdit_form_control(theForm) |
|
| return true; |
return true; |
| }',"\n\n"; |
}',"\n\n"; |
| echo '// --></script>', "\n"; |
echo '// --></script>', "\n"; |
| if ($this->display['form']) { |
$form_atts .= ' onSubmit="return phpMyEdit_form_control(this);"'; |
| echo '<form class="',$this->getCSSclass('form'); |
|
| echo '" action="',$page_name,'" method="POST"'; |
|
| echo ' onSubmit="return phpMyEdit_form_control(this);">',"\n"; |
|
| } |
|
| return true; |
|
| } |
} |
| } |
} |
| |
|
| if ($this->display['form']) { |
if ($this->display['form']) { |
| echo '<form class="',$this->getCSSclass('form'); |
echo '<form class="',$this->getCSSclass('form'); |
| echo '" action="',$page_name,'" method="POST">',"\n"; |
echo '" action="',$page_name,'" method="POST"',$form_atts,'>',"\n"; |
| } |
} |
| return true; |
return true; |
| } /* }}} */ |
} /* }}} */ |
| |
|
| |
function form_end() /* {{{ */ |
| |
{ |
| |
if ($this->display['form']) { |
| |
echo '</form>',"\n"; |
| |
} |
| |
} /* }}} */ |
| |
|
| function display_tab_labels($position) /* {{{ */ |
function display_tab_labels($position) /* {{{ */ |
| { |
{ |
| if (! is_array($this->tabs)) { |
if (! is_array($this->tabs)) { |
| Line 1677 function phpMyEdit_form_control(theForm) |
|
| Line 1680 function phpMyEdit_form_control(theForm) |
|
| /* |
/* |
| * Display the MySQL table in an HTML table |
* Display the MySQL table in an HTML table |
| */ |
*/ |
| if ($this->display['form']) { |
$this->form_begin(); |
| echo '<form class="',$this->getCSSclass('form'),'" action="'; |
|
| echo htmlspecialchars($this->page_name),'" method="POST">',"\n"; |
|
| } |
|
| echo $this->get_origvars_html($this->get_sfn_cgi_vars()); |
echo $this->get_origvars_html($this->get_sfn_cgi_vars()); |
| echo '<input type="hidden" name="fl" value="',$this->fl,'">',"\n"; |
echo '<input type="hidden" name="fl" value="',$this->fl,'">',"\n"; |
| // Display buttons at top and/or bottom of page. |
// Display buttons at top and/or bottom of page. |
| Line 2145 function phpMyEdit_form_control(theForm) |
|
| Line 2145 function phpMyEdit_form_control(theForm) |
|
| echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n"; |
echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n"; |
| $this->display_list_table_buttons($total_recs, 'down'); |
$this->display_list_table_buttons($total_recs, 'down'); |
| } |
} |
| if ($this->display['form']) { |
$this->form_end(); |
| echo '</form>',"\n"; |
|
| } |
|
| } /* }}} */ |
} /* }}} */ |
| |
|
| function display_record() /* {{{ */ |
function display_record() /* {{{ */ |
| { |
{ |
| $this->create_javascripts(); |
$this->form_begin(); |
| 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 2187 function phpMyEdit_form_control(theForm) |
|
| Line 2185 function phpMyEdit_form_control(theForm) |
|
| echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n"; |
echo '<hr class="',$this->getCSSclass('hr', 'down'),'">',"\n"; |
| $this->display_record_buttons(); |
$this->display_record_buttons(); |
| } |
} |
| if ($this->display['form']) { |
$this->form_end(); |
| echo '</form>',"\n"; |
|
| } |
|
| } /* }}} */ |
} /* }}} */ |
| |
|
| /* |
/* |