oualid
Joined: 19 Sep 2008
Posts: 3
Posted: 2012-01-20 09:36
Back to top
Reply with quote
|
Hi.
I need some help with button customization.
The following code from the documentation works:
| Code: |
$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:
| Code: |
$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
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2012-01-20 15:14
Back to top
Reply with quote
|
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
Joined: 19 Sep 2008
Posts: 3
Posted: 2012-01-20 15:36
Back to top
Reply with quote
|
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
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2012-01-20 16:37
Back to top
Reply with quote
|
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.
| Code: |
$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
Joined: 19 Sep 2008
Posts: 3
Posted: 2012-01-20 18:10
Back to top
Reply with quote
|
| doug wrote: |
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.
| Code: |
$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:
| Code: |
$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
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2012-01-22 23:44
Back to top
Reply with quote
|
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 [].
| Code: |
| $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'].
| Code: |
| $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.
| Code: |
| $opts['buttons']['V']['up'] = array('add', '-change', '-copy', 'delete', 'cancel'); |
Useful POST analysis when debugging:
| Code: |
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>';
} |
|
|
Post new topic
Reply to topic
|
|