I was needed to use tokens in link titles. I've already solved this problem and will send patch soon.

Comments

dealancer’s picture

StatusFileSize
new5.77 KB

Here is a patch. It works almost perfect (small thing to do: disallow replacing tokens while showing the list of menu item on admin menu page).

Yuriy, please grant me access to CVS, so I can commit changes and port it to D7/D5. My cvs account is vackar.

Thx

ygerasimov’s picture

Status: Active » Needs work

Vadim, thank you for the patch.

+++ menu_token/menu_token.install	(working copy)
@@ -9,5 +9,6 @@
-  variable_del('menu_token_enabled');
+  variable_del('menu_token_titles');
+  variable_del('menu_token_paths');

Lets not change variable 'menu_token_enabled' to 'menu_token_paths'. Otherwise we need update path for people who will update this module.

'menu_token_titles' variable is never used.

+++ menu_token/menu_token.module	(working copy)
@@ -75,27 +78,29 @@
+  ¶

Trailing spaces introduced.

Lets also fix the admin page before this patch gets committed. But I am not sure whether it is possible to determine whether the link is in the table or somewhere else on this page.

Powered by Dreditor.

deleuje’s picture

I am looking at this module for this exact use.

I don't mind the admin issue as the menu will only be visible to non-admin roles (using menu_per_role) . Should I go ahead and use the submitted patch? Also, would it work against the current dev (since it is very recent)?

Thanks!

deleuje’s picture

I tried and the patch fails against the current dev version. (3 out of 5 hunks failed).

dealancer’s picture

deleuje, thanks for testing.

Ok, I will rewrite it for the dev version with Yuriy's comments.

dealancer’s picture

The only way I can fix issues on the admin page (i.e. show menu items without token replacements) is to use global variable $menu_admin[1] in menu_overview_form(...)[2].

[1] http://api.drupal.org/api/drupal/developer--globals.php/global/menu_admin/6
[2] http://api.drupal.org/api/drupal/modules--menu--menu.admin.inc/function/...

dealancer’s picture

StatusFileSize
new2.98 KB

Here is a patch, it keeps variable name the same as in trunk and fixes admin issue. I haven't tested it other modules which provide admin menu functionality yet, but will do soon.

dealancer’s picture

Status: Needs work » Needs review
StatusFileSize
new5.56 KB

I have tested patch and it works perfectly with http://drupal.org/project/menu_editor.
However I have made new version of patch to indicate if tokens are used for an item.

ygerasimov’s picture

Great catch with

global $menu_admin;

I have added some theming to make menu links page nicer. Please review the patch.

dealancer’s picture

Status: Needs review » Fixed

I have commited last patch. Thanks to ygerasimov for updates and thanks to develCuy for giving me CVS access.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dealancer’s picture

Assigned: dealancer » ygerasimov
Status: Closed (fixed) » Active

@Yuriy, have you forgotten to include css file?

ygerasimov’s picture

Status: Active » Needs review
StatusFileSize
new199 bytes

Yes. I have forgotten to add it. Find attached patch. Please review.

ygerasimov’s picture

Status: Needs review » Fixed

I have committed css file to repo.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.