Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 11. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  function urlDisplay() extention

phpMyEdit Features     function urlDisplay() extention
Odoslať novú tému   Odpovedať na tému    
 
leader     Založený: 22.01.2005   Príspevky: 1  
Príspevok Zaslal: 2005-01-22 08:45
Návrat hore  Odpovedať s citátom     

when i was needed post to url additional values from table record i patched source:

Kód:

...
// add $row parameter
   function urlDisplay($k, $link_val, $disp_val, $css, $key, $row) /* {{{ */
   {
      $escape = isset($this->fdd[$k]['escape']) ? $this->fdd[$k]['escape'] : true;
      $ret  = '';
      $name = $this->fds[$k];
      $page = $this->page_name;
      $url  = $this->cgi['prefix']['sys'].'rec'.'='.$key.'&'.$this->cgi['prefix']['sys'].'fm'
         .'='.$this->fm.'&'.$this->cgi['prefix']['sys'].'fl'.'='.$this->fl;
      $url .= '&'.$this->cgi['prefix']['sys'].'qfn'.'='.rawurlencode($this->qfn).$this->qfn;
      $url .= '&'.$this->get_sfn_cgi_vars().$this->cgi['persist'];
      $ar   = array(
            'key'   => $key,
            'name'  => $name,
            'link'  => $link_val,
            'value' => $disp_val,
            'css'   => $css,
            'page'  => $page,
            'url'   => $url
            );
// added by Leader
      for ($k0 = 0; $k0 < $this->num_fds; $k0++) {
          $ar['value_'.$this->fds[$k0]] = $row['qf'.$k0];
      }
// end
....

and in function cellDisplay($k, $row, $css) /* {{{ */ i change one line:
Kód:

...
      if ($this->col_has_URL($k)) {
// next line changed adding $row parameter
         return $this->urlDisplay($k, $original_value, $value, $css, $key_rec, $row);
      }
...

now we can use macros $value_NAME for substitute values, where NAME is a name of anyfield of current record in URL parameters, for example:
Kód:
      $opts['fdd']['dummy1']['URL']='javascript:on_select($key,"$value_name","$value_price","$value_unit","$value_artnum")';
$opts['fdd']['unit_id']['URL']='units.php?key=$key&name=$value_name&price=$value_price';

i think, good idea to add this patch in main code...
leader

 
rlugo     Založený: 18.12.2007   Príspevky: 4  
Príspevok Zaslal: 2007-12-23 23:27
Návrat hore  Odpovedať s citátom     

Can It be useful in this issue?

doug Napísal:
I have this:
Kód:
$opts['fdd']['s'] = array(
  'name'     => 'Menu Entry',
  'select'   => 'T',
  'maxlen'   => 8,
  'default'  => '0',
  'required' => false,
  'sort'     => true
);

$opts['fdd']['s']['values']['table'] = 'conversion';
$opts['fdd']['s']['values']['column'] = 'seq_no';
$opts['fdd']['s']['values']['description']['columns']['0'] = 'menu_entry';


and it retrieves 'menu_entry' text for display. However I wish to display 'menu_entry' text a clickable link using the value in 'seq_no' and cannot figure out how (or if) this can be done. If the value of 'seq_no' can be saved as $seq_no I would want to do something like this, but somehow also display text from 'menu_entry':


Kód:
$opts['fdd']['s']['URL'] = 'index.php?s=$seq_no';


 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov