Topic: How to customize the shortcut menus
How can I modify the items in the shortcuts menus?
This is the menu I am talking about:
https://www.dropbox.com/s/lt217my4siu8w … u.PNG?dl=0
Is that somehow part of the theme?
It's much more fun, when you can discuss your problems with others...
You are not logged in. Please login or register.
FrontAccounting forum → Setup → How to customize the shortcut menus
How can I modify the items in the shortcuts menus?
This is the menu I am talking about:
https://www.dropbox.com/s/lt217my4siu8w … u.PNG?dl=0
Is that somehow part of the theme?
Whilst the look and feel are definitely part of the theme, the shortcuts are part of the string it shows for example in applications/customers.php which is the sales / order application tab:
class customers_app extends application
{
function customers_app()
{
$this->application("orders", _($this->help_context = "&Sales"));
$this->add_module(_("Transactions"));
$this->add_lapp_function(0, _("Sales &Quotation Entry"),
"sales/sales_order_entry.php?NewQuotation=Yes", 'SA_SALESQUOTE', MENU_TRANSACTION);
$this->add_lapp_function(0, _("Sales &Order Entry"),
..
..
The character that succeeds "&" character in the strings above are the shortcuts. If the same character is there more than once in a page, it will cycle thru them on each choice.
Attached your file here.
Thanks. What I wanted to modify is part of the theme actually.
If I want to modify the regular menu instead, I guess the best would be to write an Extensions, right?
Can you recommand a good guide for writing an extension? I only find bits and pieces of information here and there.
Hi,
I managed to make a simple extension. However I have a question.
How can I customize this icon? https://www.dropbox.com/s/caa6xjk7v6h7bzs/FA%20modules%20icons.png?dl=0
It's probably related to the $icon parameter of the module constructor but I can't find any example.
To modify the menus in your extension you need to implement the 'install_options' hook. Here's an example from one of my extensions.
To see all the hooks that are available have a look in includes/hooks.inc in the core.
To modify the icon that you see relating to any menu item you need to do 2 things:
1. Specify the category when creating the menu item. Each menu item is an instance of the app_function class. Its constructor takes a $category.
2. The renderer class in the theme has a function that maps category to icon. function get_icon($category). You can then use this to map to the icon you want.
The icon image should be within the theme folder.
Thank you for your answer.
My theme (elegant) has hardcoded the icons based on the offset of the module.
$imgs2 = array("folder.gif", "report.png", "page_edit.png", "money.png", "folder.gif");
I guess I'll have to modify the theme then.
Thanks again for your help.
The category is the last parameter (4th parameter) in the app_function class's get_icon() method. For the default standard theme, place the icon file $category.png in the theme's images folder.
Attached image referred to in 4th post here.
Thanks. I got it working with the instructions from Cambell.
FrontAccounting forum → Setup → How to customize the shortcut menus
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 4 official extensions. Copyright © 2003–2009 PunBB.