Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  function urlDisplay() extention

phpMyEdit Features     function urlDisplay() extention
Post new topic   Reply to topic    
 
leader     Joined: 22 Jan 2005   Posts: 1  
Post Posted: 2005-01-22 08:45
Back to top  Reply with quote     

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

Code:

...
// 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:
Code:

...
      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:
Code:
      $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     Joined: 18 Dec 2007   Posts: 4  
Post Posted: 2007-12-23 23:27
Back to top  Reply with quote     

Can It be useful in this issue?

doug wrote:
I have this:
Code:
$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':


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


 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy