version 1.35, 2002/12/11 23:41:54 |
version 1.36, 2002/12/12 21:42:48 |
|
|
* http://www.platon.sk/projects/phpMyEdit/ |
* http://www.platon.sk/projects/phpMyEdit/ |
*/ |
*/ |
|
|
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.34 2002/12/03 21:13:08 nepto Exp $ */ |
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.35 2002/12/11 23:41:54 nepto Exp $ */ |
|
|
/* phpMyEdit intro {{{ */ |
/* phpMyEdit intro {{{ */ |
/* |
/* |
|
|
var $next; |
var $next; |
var $sw; // filter display/hide button |
var $sw; // filter display/hide button |
var $labels; // labels for buttons, etc (multilingual) |
var $labels; // labels for buttons, etc (multilingual) |
|
var $cgi; // CGI variable features array |
|
var $url; // URL array |
var $operation; // operation to do: Add, Change, Delete |
var $operation; // operation to do: Add, Change, Delete |
var $message; // informational message to print |
var $message; // informational message to print |
|
|
|
|
$file = $this->dir['lang'].'PME.lang.EN.inc'; |
$file = $this->dir['lang'].'PME.lang.EN.inc'; |
} |
} |
$ret = @include($file); |
$ret = @include($file); |
|
if (! is_array($ret)) { |
|
return $ret; |
|
} |
// XXX: temporary "Apply" keyword hack -- add it into lang files |
// XXX: temporary "Apply" keyword hack -- add it into lang files |
!isset($ret['Apply']) && $ret['Apply'] = 'Apply'; |
!isset($ret['Apply']) && $ret['Apply'] = 'Apply'; |
!isset($ret['of']) && $ret['of'] = '/'; |
!isset($ret['of']) && $ret['of'] = '/'; |
Line 1545 function form_control(theForm) |
|
Line 1550 function form_control(theForm) |
|
echo '<hr>'."\n"; |
echo '<hr>'."\n"; |
} |
} |
|
|
|
if ($this->cgi['persist'] != '') { |
|
$this->write_origvars_html($this->cgi['persist']); |
|
} |
if (!$this->fl) { |
if (!$this->fl) { |
echo($hidden_qfs); |
echo($hidden_qfs); |
} |
} |
Line 1604 function form_control(theForm) |
|
Line 1612 function form_control(theForm) |
|
$new_sfn = $this->sfn; |
$new_sfn = $this->sfn; |
array_unshift($new_sfn, in_array("$k", $new_sfn, 1) ? "-$k" : $k); |
array_unshift($new_sfn, in_array("$k", $new_sfn, 1) ? "-$k" : $k); |
echo '<th'.$w.'><a href="'.$this->page_name.'?fm=0&fl='.$this->fl; |
echo '<th'.$w.'><a href="'.$this->page_name.'?fm=0&fl='.$this->fl; |
echo '&'.$this->get_sfn_cgi_vars($new_sfn); |
echo '&'.$this->get_sfn_cgi_vars($new_sfn).$this->cgi['persist']; |
echo $this->qfn.'">'.$fdn.'</a></th>'."\n"; |
echo $this->qfn.'">'.$fdn.'</a></th>'."\n"; |
} else { |
} else { |
echo '<th'.$w.'>'.$fdn.'</th>'."\n"; |
echo '<th'.$w.'>'.$fdn.'</th>'."\n"; |
Line 1677 function form_control(theForm) |
|
Line 1685 function form_control(theForm) |
|
// XXX this doesn't preserve filters |
// XXX this doesn't preserve filters |
echo '<tr>'; |
echo '<tr>'; |
if (isset($this->sfn)) { |
if (isset($this->sfn)) { |
echo '<td align="center">'. |
$cgi_persist = $this->cgi['persist']; |
'<a class="pme_a_t" href="'.$PHP_SELF.'">'.$this->labels['Clear'].'</a>'. |
$cgi_persist != '' && $cgi_persist[0] = '?'; |
'</td>'; |
echo '<td align="center">' |
|
.'<a class="pme_a_t" href="'.$PHP_SELF.$cgi_persist,'">' |
|
.$this->labels['Clear'].'</a>'.'</td>'; |
echo '<td colspan="'.($this->num_fields_displayed + $sys_cols - 1).'">Sorted By: '; |
echo '<td colspan="'.($this->num_fields_displayed + $sys_cols - 1).'">Sorted By: '; |
} else { |
} else { |
echo '<td colspan="'.($this->num_fields_displayed + $sys_cols).'">Default Sort Order: '; |
echo '<td colspan="'.($this->num_fields_displayed + $sys_cols).'">Default Sort Order: '; |
Line 1849 function form_control(theForm) |
|
Line 1859 function form_control(theForm) |
|
echo '<tr><td colspan='.$sys_cols.' align="center">' |
echo '<tr><td colspan='.$sys_cols.' align="center">' |
.'<a class="pme_a_t" href="'.$PHP_SELF; |
.'<a class="pme_a_t" href="'.$PHP_SELF; |
echo '?sfn='.$this->get_sfn_cgi_vars().'&fl='.$this->fl.'&fm='.$this->fm; |
echo '?sfn='.$this->get_sfn_cgi_vars().'&fl='.$this->fl.'&fm='.$this->fm; |
echo '">'.$this->labels['Clear'].'</a></td>'; |
echo $this->cgi['persist'].'">'.$this->labels['Clear'].'</a></td>'; |
echo '<td colspan="'.$this->num_fields_displayed.'">Current Query: ' |
echo '<td colspan="'.$this->num_fields_displayed.'">Current Query: ' |
.htmlspecialchars(stripslashes(stripslashes(stripslashes($text_query)))) |
.htmlspecialchars(stripslashes(stripslashes(stripslashes($text_query)))) |
.'</td></tr>'."\n"; |
.'</td></tr>'."\n"; |
Line 1906 function form_control(theForm) |
|
Line 1916 function form_control(theForm) |
|
echo '<tr class="'.(($rowCount++%2)?'pme_tr_o':'pme_tr_e')."\">\n"; |
echo '<tr class="'.(($rowCount++%2)?'pme_tr_o':'pme_tr_e')."\">\n"; |
if ($sys_cols) { |
if ($sys_cols) { |
$key_rec = $row['qf'.$this->key_num]; |
$key_rec = $row['qf'.$this->key_num]; |
$qviewStr = $qpviewStr .'&rec='.$key_rec; |
$qviewStr = $qpviewStr .'&rec='.$key_rec.$this->cgi['persist']; |
$qcopyStr = $qpcopyStr .'&rec='.$key_rec; |
$qcopyStr = $qpcopyStr .'&rec='.$key_rec.$this->cgi['persist']; |
$qchangeStr = $qpchangeStr.'&rec='.$key_rec; |
$qchangeStr = $qpchangeStr.'&rec='.$key_rec.$this->cgi['persist']; |
$qdeleteStr = $qpdeleteStr.'&rec='.$key_rec; |
$qdeleteStr = $qpdeleteStr.'&rec='.$key_rec.$this->cgi['persist']; |
if ($select_recs) { |
if ($select_recs) { |
if (! $this->nav_buttons() || $sys_cols > 1) { |
if (! $this->nav_buttons() || $sys_cols > 1) { |
echo '<td style="white-space:nowrap;text-align:center;" width="1%">'; |
echo '<td style="white-space:nowrap;text-align:center;" width="1%">'; |
Line 2040 function form_control(theForm) |
|
Line 2050 function form_control(theForm) |
|
$name = $this->fds[$k]; |
$name = $this->fds[$k]; |
$value = $row["qf$k"]; |
$value = $row["qf$k"]; |
$page = $this->page_name; |
$page = $this->page_name; |
$urlstr = $urlqueryproto.'&rec='.$key; |
$urlstr = $urlqueryproto.'&rec='.$key.$this->cgi['persist']; |
$urllink = isset($this->fdd[$k]['URL']) |
$urllink = isset($this->fdd[$k]['URL']) |
? eval('return "'.$this->fdd[$k]['URL'].'";') |
? eval('return "'.$this->fdd[$k]['URL'].'";') |
: $value; |
: $value; |
Line 2194 function form_control(theForm) |
|
Line 2204 function form_control(theForm) |
|
{ |
{ |
$this->create_javascripts(); |
$this->create_javascripts(); |
|
|
|
if ($this->cgi['persist'] != '') { |
|
$this->write_origvars_html($this->cgi['persist']); |
|
} |
echo '<input type="hidden" name="rec" value="'.($this->copy_operation()?'':$this->rec).'">'."\n"; |
echo '<input type="hidden" name="rec" value="'.($this->copy_operation()?'':$this->rec).'">'."\n"; |
echo '<input type="hidden" name="fm" value="'.$this->fm.'">'."\n"; |
echo '<input type="hidden" name="fm" value="'.$this->fm.'">'."\n"; |
$this->write_origvars_html($this->get_sfn_cgi_vars()); |
$this->write_origvars_html($this->get_sfn_cgi_vars()); |
Line 2768 echo '<h5>'.@mysql_affected_rows($this-> |
|
Line 2781 echo '<h5>'.@mysql_affected_rows($this-> |
|
// Let's do explicit quoting - it's safer |
// Let's do explicit quoting - it's safer |
set_magic_quotes_runtime(0); |
set_magic_quotes_runtime(0); |
|
|
/* Database connection */ |
// Checking if language file inclusion was successful |
if ($this->connect() == false) |
if (! is_array($this->labels)) { |
|
$this->error('could not locate language files'); |
|
return false; |
|
} |
|
|
|
// Database connection |
|
if ($this->connect() == false) { |
return false; |
return false; |
|
} |
|
|
/* |
/* |
* ====================================================================== |
* ====================================================================== |
Line 2911 echo '<h5>'.@mysql_affected_rows($this-> |
|
Line 2931 echo '<h5>'.@mysql_affected_rows($this-> |
|
// CGI variables |
// CGI variables |
$this->cgi['append'] = $opts['cgi']['append']; |
$this->cgi['append'] = $opts['cgi']['append']; |
$this->cgi['overwrite'] = $opts['cgi']['overwrite']; |
$this->cgi['overwrite'] = $opts['cgi']['overwrite']; |
|
$this->cgi['persist'] = ''; |
|
if (@is_array($opts['cgi']['persist'])) { |
|
foreach ($opts['cgi']['persist'] as $key => $val) { |
|
$this->cgi['persist'] .= '&'.urlencode($key).'='.urlencode($val); |
|
} |
|
} |
|
|
/* |
/* |
* Find the URL to post forms |
* Find the URL to post forms |