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

phpMyEdit General     Custom buttons
Odoslať novú tému   Odpovedať na tému    
 
oualid     Založený: 19.09.2008   Príspevky: 3  
Príspevok Zaslal: 2012-01-20 09:36
Návrat hore  Odpovedať s citátom     

Hi.

I need some help with button customization.

The following code from the documentation works:

Kód:

$opts['buttons']['V']['up'] = array(
   'change',
   'cancel',
   array('name' => 'pme_back', 'value' => 'Back to main menu',
         'css' => 'pme-backtomenu', 'disabled' => false),
   'Go to:',
   array('code' => '<SELECT><OPTION>....</OPTION></SELECT>'),
);
$opts['buttons']['V']['down'] = $opts['buttons']['V']['up'];



But not this. Nothing happens when the button is pressed:

Kód:

$opts['buttons']['L']['up'] = array('<<','<','add',
array('name' => 'pme_add', 'value' => 'Send email', 'css' => 'pme-add'),
'view','-change','-copy','delete',
'>','>>','goto','goto_combo');
$opts['buttons']['L']['down'] = $opts['buttons']['L']['up'];



pme_back does work but not pme_add.

/Oualid

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2012-01-20 15:14
Návrat hore  Odpovedať s citátom     

FYI, usage of GoTo completely ruins performance if the table contains a lot of records. Referring to the documentation, I don't find pme_add listed as a valid option.
http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.navigation.html

 
oualid     Založený: 19.09.2008   Príspevky: 3  
Príspevok Zaslal: 2012-01-20 15:36
Návrat hore  Odpovedať s citátom     

doug Napísal:
FYI, usage of GoTo completely ruins performance if the table contains a lot of records. Referring to the documentation, I don't find pme_add listed as a valid option.
http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.navigation.html


I am not interested in Goto feature. I am interested to add a new button with the text "Add new entry". When I press the "Add new entry" button I would like to add a new entry exactly in the same way as I press the Add button. How do I do that? The pme_add doesn't work. Which option do I have to use?

The example in the documentation uses the option "pme_back" and it works.

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2012-01-20 16:37
Návrat hore  Odpovedať s citátom     

In which page mode (List or View) did you want the button to appear? The following appears to work in one of my forms, in View mode (displaying Add, Change, Copy, Delete, and Cancel buttons). To change the text label from "Add" to "Add new entry" you would probably need to edit the appropriate language include file.


Kód:
$opts['navigation'] = 'GUD';

$opts['buttons']['L']['up'] = array('<<', '<', 'add', '>', '>>');

$opts['buttons']['L']['down'] = $opts['buttons']['L']['up'];

$opts['buttons']['F']['up'] = array('<<', '<', 'add', '>', '>>');

$opts['buttons']['F']['down'] = $opts['buttons']['F']['up'];

//$opts['buttons']['V']['up'] = array('change', 'cancel');

//$opts['buttons']['V']['down'] = $opts['buttons']['V']['up'];

$opts['buttons']['V']['up'] = array('add', '-change', '-copy', 'delete', 'cancel');

$opts['buttons']['V']['down'] = $opts['buttons']['L']['up'];


 
oualid     Založený: 19.09.2008   Príspevky: 3  
Príspevok Zaslal: 2012-01-20 18:10
Návrat hore  Odpovedať s citátom     

doug Napísal:
In which page mode (List or View) did you want the button to appear? The following appears to work in one of my forms, in View mode (displaying Add, Change, Copy, Delete, and Cancel buttons). To change the text label from "Add" to "Add new entry" you would probably need to edit the appropriate language include file.


Kód:
$opts['navigation'] = 'GUD';

$opts['buttons']['L']['up'] = array('<<', '<', 'add', '>', '>>');

$opts['buttons']['L']['down'] = $opts['buttons']['L']['up'];

$opts['buttons']['F']['up'] = array('<<', '<', 'add', '>', '>>');

$opts['buttons']['F']['down'] = $opts['buttons']['F']['up'];

//$opts['buttons']['V']['up'] = array('change', 'cancel');

//$opts['buttons']['V']['down'] = $opts['buttons']['V']['up'];

$opts['buttons']['V']['up'] = array('add', '-change', '-copy', 'delete', 'cancel');

$opts['buttons']['V']['down'] = $opts['buttons']['L']['up'];


I would like to add another button in list page like this:
Kód:


$opts['buttons']['L']['up'] = array('<<','<','add',

array('name' => 'pme_add', 'value' => 'Add new entry', 'css' => 'pme-add', 'disabled' => false),

'view','-change','-copy','delete',
                              '>','>>','goto','goto_combo');

$opts['buttons']['L']['down'] = $opts['buttons']['L']['up'];



When the "Add new entry" button is pressed it suppose to add a new entry in the same way the 'add' option does but nothing happens.
The 'pme_add' option doesn't work.

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2012-01-22 23:44
Návrat hore  Odpovedať s citátom     

For non-working custom List-mode buttons, try the 'F' mode instead of 'L' mode. Note the value is capitalized below as Add, and post-initialized using [].

Kód:
$opts['buttons']['F']['up'][] = array('name' => 'operation', 'value' => 'Add', 'css' => 'pme-foo', 'disabled' => false);



Random thoughts follow. The 'foo' button (when clicked) becomes available as $_POST['PME_sys_foo'].

Kód:
$opts['buttons']['V']['up'][] = array('name' => 'foo', 'value' => 'Foo', 'css' => 'pme-foo', 'disabled' => false);


It sometimes makes sense in View-1-record mode to display buttons for Add, Change, and Delete.

Kód:
$opts['buttons']['V']['up'] = array('add', '-change', '-copy', 'delete', 'cancel');


Useful POST analysis when debugging:

Kód:
if(isset($_POST)){
   $print_r_text = preg_replace('/\n/s', "\r\n", print_r($_POST, true));
   echo !stristr($print_r_text, ']') ? '' : "\n".'<p>$_POST</p><pre>'.htmlspecialchars($print_r_text).'</pre>';
}


 
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